Re: [PATCH v5 09/17] mm/sparse: initialize memory sections earlier

From: Qi Zheng

Date: Tue Aug 25 2026 - 08:50:36 EST




On 8/25/26 4:46 PM, Muchun Song wrote:
Upcoming HugeTLB bootmem changes need sparsemem section metadata before
the HugeTLB bootmem allocation path runs. The memory sections are
initialized from sparse_init(), which is called too late for that setup.

Move the code that initializes sparsemem section metadata for memblock
ranges into mm_core_init_early(), before free_area_init() and the HugeTLB
bootmem setup. Rename the helper to sparse_sections_init() so the new
caller describes the sparsemem-specific initialization step.

This is a preparatory change.

Signed-off-by: Muchun Song <songmuchun@xxxxxxxxxxxxx>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@xxxxxxxxxx>

Acked-by: Qi Zheng <qi.zheng@xxxxxxxxx>

Thanks,
Qi