Re: [PATCH v3 11/11] mm/mm_init: move pageblock migratetype init to memmap helpers
From: Qi Zheng
Date: Mon Nov 23 2026 - 03:20:15 EST
On 11/20/26 6:08 PM, Muchun Song wrote:
ZONE_DEVICE memmap initialization already initializes pageblock
migratetype after all struct pages have been initialized, while hugetlb
bootmem folios have their own duplicate bootmem-specific initialization.
Move the MIGRATE_MOVABLE pageblock initialization into the frozen memmap
initialization helpers instead, so the ZONE_DEVICE and hugetlb bootmem
paths can share the same initialization.
The old hugetlb_bootmem_init_migratetype() skipped CMA folios via
folio_test_hugetlb_cma(), but the shared helper always initializes
pageblocks as MIGRATE_MOVABLE. This is safe because cma_activate_area()
later overrides the migratetype for CMA pageblocks.
Signed-off-by: Muchun Song <songmuchun@xxxxxxxxxxxxx>
---
v2:
- Fix the helper name in the commit message (reported by Sashiko).
---
mm/hugetlb.c | 25 -------------------------
mm/mm_init.c | 11 ++++++-----
2 files changed, 6 insertions(+), 30 deletions(-)
Acked-by: Qi Zheng <qi.zheng@xxxxxxxxx>
Thanks,
Qi