Re: [PATCH 08/17] mm/sparse: mark memory sections present earlier

From: Mike Rapoport

Date: Thu Jul 09 2026 - 07:25:05 EST


On Thu, Jul 02, 2026 at 05:38:12PM +0800, Muchun Song wrote:
> Upcoming HugeTLB bootmem changes need sparsemem section metadata before
> the HugeTLB bootmem allocation path runs. The memblock ranges are marked
> present from sparse_init(), which is called too late for that setup.

It's not only that memblock regions are marked present, but it actually
initializes mem_section's for the present memory ...

> Move the code that marks memblock ranges present into
> mm_core_init_early(), before free_area_init() and the HugeTLB bootmem
> setup. Rename the helper to sparse_memblock_present() to make the new

... so let's name this function to reflect that.

How about sparse_sections_init()?

> caller describe the sparsemem-specific initialization step.
>
> This is a preparatory change.
>
> Signed-off-by: Muchun Song <songmuchun@xxxxxxxxxxxxx>
> ---
> mm/internal.h | 2 ++
> mm/mm_init.c | 1 +
> mm/sparse.c | 4 +---
> 3 files changed, 4 insertions(+), 3 deletions(-)

--
Sincerely yours,
Mike.