[PATCH 4/7] mm: Use folios_put() in __folio_batch_release()

From: Matthew Wilcox (Oracle)
Date: Mon Aug 21 2023 - 16:45:03 EST


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.

Signed-off-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx>
---
mm/swap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/swap.c b/mm/swap.c
index 11ca25d4843f..9d31185dc27b 100644
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -1072,7 +1072,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));
+ folios_put(fbatch);
folio_batch_reinit(fbatch);
}
EXPORT_SYMBOL(__folio_batch_release);
--
2.40.1