diff mbox series

[1/4] mm/swap: Free non-hugetlb large folios in a batch

Message ID 20240302070031.3108523-2-willy@infradead.org (mailing list archive)
State New
Headers show
Series Clean up __folio_put() | expand

Commit Message

Matthew Wilcox March 2, 2024, 7 a.m. UTC
free_unref_folios() can now handle non-hugetlb large folios, so
keep normal large folios in the batch.  hugetlb folios still need
special treatment (and I think they can be freed this way).

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 mm/swap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/mm/swap.c b/mm/swap.c
index 6b697d33fa5b..d1e016e9ee1a 100644
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -158,8 +158,8 @@  void put_pages_list(struct list_head *pages)
 	list_for_each_entry(folio, pages, lru) {
 		if (!folio_put_testzero(folio))
 			continue;
-		if (folio_test_large(folio)) {
-			__folio_put_large(folio);
+		if (folio_test_hugetlb(folio)) {
+			free_huge_folio(folio);
 			continue;
 		}
 		/* LRU flag must be clear because it's passed using the lru */