From a529261d22966b82fb77cc744b65737bc9911b9e Mon Sep 17 00:00:00 2001 From: "Matthew Wilcox (Oracle)" Date: Thu, 6 May 2021 08:42:34 -0400 Subject: [PATCH] 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) --- include/linux/swap.h | 4 ++++ 1 file changed, 4 insertions(+) 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); -- 2.51.0