Re: [PATCH] mm: Add CONFIG_SPARSEMEM_CLASSIC
From: Anshuman Khandual
Date: Wed Sep 23 2026 - 01:47:45 EST
On Mon, Sep 21, 2026 at 12:34:48PM +0200, David Hildenbrand (Arm) wrote:
> On 9/20/26 09:04, Kaitao Cheng wrote:
> > From: Kaitao Cheng <chengkaitao@xxxxxxxxxx>
> >
> > Several MM paths identify classic sparse memory by testing
> > CONFIG_SPARSEMEM while also testing that CONFIG_SPARSEMEM_VMEMMAP is
> > disabled. Repeating the compound condition obscures the memory model being
> > selected and requires the local SECTION_IN_PAGE_FLAGS alias for the same
> > state.
> >
> > Add CONFIG_SPARSEMEM_CLASSIC as a hidden derived option and use it at the
> > conditional sites. Remove SECTION_IN_PAGE_FLAGS and test the new option
> > directly.
>
> Sorry, but reading CONFIG_SPARSEMEM_CLASSIC I would have no idea how it relates
> to VMEMMAP.
>
> CONFIG_SPARSEMEM && !CONFIG_SPARSEMEM_VMEMMAP
>
> is pretty clear in comparison.
Probably there could be an argument to clearly differentiate base and vmemmmap
sparsemem mechanisms, but the proposed patch here does not make it any better.
>
> --
> Cheers,
>
> David