Re: [PATCH 01/11] mm/mm_init: verify zones for template-initialized pages
From: Mike Rapoport
Date: Thu Nov 12 2026 - 11:31:57 EST
Hi,
On Mon, Nov 09, 2026 at 05:57:56PM +0800, Muchun Song wrote:
> Template-based ZONE_DEVICE initialization bypasses
> __init_single_page(), which means copied struct pages do not run the
> vmemmap zone consistency check.
>
> Verify each destination after copying the template so the fast path gets
> the same validation as regular page initialization.
>
> Signed-off-by: Muchun Song <songmuchun@xxxxxxxxxxxxx>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@xxxxxxxxxx>
I'll wait for the next version before reviewing the rest.
> ---
> mm/mm_init.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/mm/mm_init.c b/mm/mm_init.c
> index a9d848c92678..0129152b74d8 100644
> --- a/mm/mm_init.c
> +++ b/mm/mm_init.c
> @@ -1082,6 +1082,7 @@ static void zone_device_page_init_from_template(struct page *page,
> set_page_address(template, __va(pfn << PAGE_SHIFT));
> #endif
> memcpy_nontemporal(page, template, sizeof(*page));
> + vmemmap_optimization_verify_zone(page);
> }
>
> /*
> --
> 2.54.0
>
--
Sincerely yours,
Mike.