Re: [PATCH v2 00/14] mm: Unify memmap initialization for compound pages
From: Mike Rapoport
Date: Mon Nov 16 2026 - 05:43:10 EST
Hi,
> Hi,
>
> This v2 is based on the mm-new branch at commit daed51c91051.
>
> This series is split out from the earlier, larger series
> "mm: Generalize HVO for HugeTLB and device DAX" [1]. That series
> generalized vmemmap optimization across HugeTLB and device DAX. One
> remaining piece is the separate compound struct page initialization used
> by boot-time gigantic HugeTLB pages and compound ZONE_DEVICE ranges.
>
> This v2 also folds in Li Zhe's two-patch series, using that series' v2
> as the integration point [2].
>
> Li Zhe (2):
> mm/mm_init: factor out memmap_init_page_from_template()
> mm/hugetlb: optimize bootmem hugepage tail vmemmap init
>
> Muchun Song (12):
> mm/mm_init: verify zones for template-initialized pages
> mm/mm_init: factor out common struct page initialization
> mm/mm_init: simplify zone device page initialization
> mm/mm_init: factor out frozen compound page initialization
> mm/hugetlb: drop boot-time HVO handling for gigantic folios
> mm/hugetlb: initialize all struct pages for bootmem hugepages
> mm/hugetlb: use common compound page initialization helper
> mm/mm_init: make __init_single_page() static
> mm/mm_init: make memmap_init_page_from_template() static
> mm/cma: centralize CMA pageblock initialization
> mm/cma: localize init_cma_pageblock() to cma.c
> mm/mm_init: move pageblock migratetype init to memmap helpers
>
> include/linux/mm.h | 8 --
> mm/cma.c | 24 +++--
> mm/hugetlb.c | 111 ++-----------------
> mm/hugetlb_vmemmap.c | 17 +--
> mm/mm_init.c | 247 +++++++++++++++++--------------------------
> mm/mm_init.h | 13 +--
> mm/sparse-vmemmap.c | 7 +-
> 7 files changed, 129 insertions(+), 298 deletions(-)
That's nice :)
The series would be easier to review if Li Zhe's patches were integrated
rather than stacked in. I hoped that the changes for template
initialization would fit into the patches that rework other parts.
The way it's done now several patches in the beginning of the series
change code that the later patches remove or turn some of new functions
into static.
Another thing is that the numbers Li Zhe measured were for a different
implementation, so they would be stale for the state after these
changes.
I have some nits and naming comments in a few patches, other than that
the series LGTM.
--
Sincerely yours,
Mike.