Re: [PATCH v3 03/11] mm/mm_init: simplify zone device page initialization
From: Oscar Salvador (SUSE)
Date: Mon Nov 23 2026 - 04:24:38 EST
On Fri, Nov 20, 2026 at 06:08:48PM +0800, Muchun Song wrote:
> memmap_init_zone_device() currently seeds its reusable head and tail
> templates by fully initializing the first real struct page and copying
> it back into a stack object. This keeps the first page outside the
> common loops and leaves __init_zone_device_page() only for template
> construction.
>
> Build both templates directly from the PFN-independent state. Add the
> head-specific pgmap and refcount state to the head template and the
> compound metadata to the tail template, then initialize every page
> through zone_device_page_init_from_template().
>
> This removes the special handling for the first head and tail pages
> without changing their final state.
>
> Signed-off-by: Muchun Song <songmuchun@xxxxxxxxxxxxx>
Reviewed-by: Oscar Salvador (SUSE) <osalvador@xxxxxxxxxx>
--
Oscar Salvador
SUSE Labs