]> www.infradead.org Git - users/willy/pagecache.git/commitdiff
mm/swap: Add folio_throttle_swaprate folio-tested
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Thu, 6 May 2021 12:42:34 +0000 (08:42 -0400)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Tue, 28 Sep 2021 16:45:38 +0000 (12:45 -0400)
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) <willy@infradead.org>
include/linux/swap.h

index cdf0957a88a49a343307646f1ea0c5cbb90cdd33..a05e73927bbac0eb9cda65dc2bfced1b70a74ea1 100644 (file)
@@ -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);