summaryrefslogtreecommitdiff
path: root/include/linux/swap.h
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2022-05-12 20:23:04 -0700
committerAndrew Morton <akpm@linux-foundation.org>2022-05-13 07:20:16 -0700
commit039bc1240165c99b932fb4be2f784948d1038eea (patch)
tree08b225cc38cfbcb40c443897ba7ca25f263ccfb6 /include/linux/swap.h
parent0562457186752b6a65eeca9f5ed0fb9b1e2572e3 (diff)
mm/swap: add folio_throttle_swaprate
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. Link: https://lkml.kernel.org/r/20220504182857.4013401-18-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'include/linux/swap.h')
-rw-r--r--include/linux/swap.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 252c23a6667f..6bf1506e5080 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -640,6 +640,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);