Subject: Re: [PATCH 10/49] mm: move subsection_map_init() into sparse_init()

From: Muchun Song <[email-masked]>
Date: Wed, 29 Apr 2026 11:06:15 +0800

> On Apr 28, 2026, at 15:06, Mike Rapoport <[email-masked]> wrote:
> 
> On Sun, Apr 05, 2026 at 08:52:01PM +0800, Muchun Song wrote:
>> Move the initialization of the subsection map from free_area_init()
>> into sparse_init(). This encapsulates the logic within the sparse
>> memory initialization code.
>> 
>> Signed-off-by: Muchun Song <[email-masked]>
> 
> Acked-by: Mike Rapoport (Microsoft) <[email-masked]>

Thanks.

> 
>> ---
>> mm/internal.h       |  5 ++---
>> mm/mm_init.c        | 10 ++--------
>> mm/sparse-vmemmap.c | 11 ++++++++++-
>> mm/sparse.c         |  1 +
>> 4 files changed, 15 insertions(+), 12 deletions(-)
>> 
>> diff --git a/mm/internal.h b/mm/internal.h
>> index edb1c04d0617..d70075d0e788 100644
>> --- a/mm/internal.h
>> +++ b/mm/internal.h
>> @@ -1004,10 +1004,9 @@ static inline void sparse_init(void) {}
>>  * mm/sparse-vmemmap.c
>>  */
>> #ifdef CONFIG_SPARSEMEM_VMEMMAP
>> -void sparse_init_subsection_map(unsigned long pfn, unsigned long nr_pages);
>> +void sparse_init_subsection_map(void);
>> #else
>> -static inline void sparse_init_subsection_map(unsigned long pfn,
>> - 	unsigned long nr_pages)
>> +static inline void sparse_init_subsection_map(void)
>> {
>> }
>> #endif /* CONFIG_SPARSEMEM_VMEMMAP */
> 
> I side note: we might want to split out mm/sparse.h and also move some
> declarations from include/linux/mmzone.h there.

I think we can do that in a separate series for cleanup only.

Thanks.