Re: [PATCH v3 02/11] mm/mm_init: factor out common struct page initialization

From: Oscar Salvador (SUSE)

Date: Mon Nov 23 2026 - 04:21:44 EST


On Fri, Nov 20, 2026 at 06:08:47PM +0800, Muchun Song wrote:
> Several struct page fields have the same initial values for every page in
> a zone. __init_single_page() initializes this state as part of its
> per-page setup, while the shared vmemmap tail path open-codes only a
> subset.
>
> Factor the PFN-independent state into memmap_init_page() and use it for
> both regular and shared tail struct pages. Keep section-, PFN- and
> instance-specific initialization in __init_single_page().
>
> This also initializes the last cpupid and KASAN tag for shared tail
> struct pages consistently with regular struct pages. Since
> memmap_init_page() marks ZONE_DEVICE pages reserved, remove the redundant
> update from the memory hotplug path.
>
> Signed-off-by: Muchun Song <songmuchun@xxxxxxxxxxxxx>

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



--
Oscar Salvador
SUSE Labs