From c7f67cfb850a6a6e3ca665e9636b84b66c3ff1d8 Mon Sep 17 00:00:00 2001 From: "Matthew Wilcox (Oracle)" Date: Tue, 27 Feb 2024 17:42:38 +0000 Subject: [PATCH] UPSTREAM: mm: use folios_put() in __folio_batch_release() There's no need to indirect through release_pages() and iterate over this batch of folios an extra time; we can just use the batch that we have. Link: https://lkml.kernel.org/r/20240227174254.710559-5-willy@infradead.org Change-Id: Ia81f646da277bd7b043a9cabca091814ea67fd7f Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Ryan Roberts Cc: David Hildenbrand Cc: Mel Gorman Signed-off-by: Andrew Morton (cherry picked from commit 6871cc5742f411bf8ebbcb78b4afeb992d888228) Bug: 420771453 Signed-off-by: Kalesh Singh --- mm/swap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/swap.c b/mm/swap.c index 16052067e79c..c86b2bb8337d 100644 --- a/mm/swap.c +++ b/mm/swap.c @@ -1083,8 +1083,7 @@ void __folio_batch_release(struct folio_batch *fbatch) lru_add_drain(); fbatch->percpu_pvec_drained = true; } - release_pages(fbatch->folios, folio_batch_count(fbatch)); - folio_batch_reinit(fbatch); + folios_put(fbatch); } EXPORT_SYMBOL(__folio_batch_release);