From: Matthew Wilcox (Oracle) Date: Thu, 6 May 2021 12:42:34 +0000 (-0400) Subject: mm/swap: Add folio_throttle_swaprate X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Ffolio-tested;p=users%2Fwilly%2Fpagecache.git 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 there's no need to convert the page to a folio before calling it. Signed-off-by: Matthew Wilcox (Oracle) --- diff --git a/include/linux/swap.h b/include/linux/swap.h index cdf0957a88a49..a05e73927bbac 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -740,6 +740,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 extern void mem_cgroup_swapout(struct page *page, swp_entry_t entry);