[PATCH] fixup: make init_pageblock_migratetype() set right migratetype.

From: Zi Yan
Date: Mon Jun 02 2025 - 21:51:25 EST


when page_group_by_mobility_disabled is 1.

Signed-off-by: Zi Yan <ziy@xxxxxxxxxx>
---
mm/page_alloc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 0867e2b2e187..ff098523a501 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -552,12 +552,14 @@ void __meminit init_pageblock_migratetype(struct page *page,
enum migratetype migratetype,
bool isolate)
{
- unsigned long flags = migratetype;
+ unsigned long flags;

if (unlikely(page_group_by_mobility_disabled &&
migratetype < MIGRATE_PCPTYPES))
migratetype = MIGRATE_UNMOVABLE;

+ flags = migratetype;
+
#ifdef CONFIG_MEMORY_ISOLATION
if (migratetype == MIGRATE_ISOLATE) {
VM_WARN_ONCE(
--
2.47.2




Best Regards,
Yan, Zi