Re: [PATCH v3 11/11] mm/mm_init: move pageblock migratetype init to memmap helpers

From: Oscar Salvador (SUSE)

Date: Mon Nov 23 2026 - 04:42:53 EST


On Fri, Nov 20, 2026 at 06:08:56PM +0800, 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>

Acked-by: Oscar Salvador (SUSE) <osalvador@xxxxxxxxxx>



--
Oscar Salvador
SUSE Labs