[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240320180429.678181-5-hannes@cmpxchg.org>
Date: Wed, 20 Mar 2024 14:02:09 -0400
From: Johannes Weiner <hannes@...xchg.org>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Vlastimil Babka <vbabka@...e.cz>,
Mel Gorman <mgorman@...hsingularity.net>,
Zi Yan <ziy@...dia.com>,
"Huang, Ying" <ying.huang@...el.com>,
David Hildenbrand <david@...hat.com>,
linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 04/10] mm: page_alloc: move free pages when converting block during isolation
When claiming a block during compaction isolation, move any remaining
free pages to the correct freelists as well, instead of stranding them
on the wrong list. Otherwise, this encourages incompatible page mixing
down the line, and thus long-term fragmentation.
Reviewed-by: Zi Yan <ziy@...dia.com>
Reviewed-by: Vlastimil Babka <vbabka@...e.cz>
Acked-by: Mel Gorman <mgorman@...hsingularity.net>
Tested-by: "Huang, Ying" <ying.huang@...el.com>
Signed-off-by: Johannes Weiner <hannes@...xchg.org>
---
mm/page_alloc.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 4529893d9f04..a1376a6fe7e4 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2683,9 +2683,12 @@ int __isolate_free_page(struct page *page, unsigned int order)
* Only change normal pageblocks (i.e., they can merge
* with others)
*/
- if (migratetype_is_mergeable(mt))
+ if (migratetype_is_mergeable(mt)) {
set_pageblock_migratetype(page,
MIGRATE_MOVABLE);
+ move_freepages_block(zone, page,
+ MIGRATE_MOVABLE, NULL);
+ }
}
}
--
2.44.0
Powered by blists - more mailing lists