diff mbox series

[15/21] mm/swap: Add folio_throttle_swaprate

Message ID 20220429192329.3034378-16-willy@infradead.org (mailing list archive)
State New
Headers show
Series Folio patches for 5.19 | expand

Commit Message

Matthew Wilcox (Oracle) April 29, 2022, 7:23 p.m. UTC
The only use of the page argument to cgroup_throttle_swaprate() is to
get the node ID, and this will be the same for all pages in the folio,
so just pass in the first page of the folio.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 include/linux/swap.h | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/include/linux/swap.h b/include/linux/swap.h
index f87bb495e482..96f7129f6ee2 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -736,6 +736,10 @@  static inline void cgroup_throttle_swaprate(struct page *page, gfp_t gfp_mask)
 {
 }
 #endif
+static inline void folio_throttle_swaprate(struct folio *folio, gfp_t gfp)
+{
+	cgroup_throttle_swaprate(&folio->page, gfp);
+}
 
 #ifdef CONFIG_MEMCG_SWAP
 void mem_cgroup_swapout(struct folio *folio, swp_entry_t entry);