Re: [PATCH] mm: Add CONFIG_SPARSEMEM_CLASSIC

From: Muchun Song

Date: Sun Sep 20 2026 - 05:59:55 EST




> On Sep 20, 2026, at 15:04, Kaitao Cheng <kaitao.cheng@xxxxxxxxx> 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.
>
> The x86 32-bit vDSO build starts with the x86_64 configuration and then
> undefines CONFIG_SPARSEMEM_VMEMMAP to emulate a 32-bit configuration.
> Kconfig-derived symbols are not recomputed by the C preprocessor, so define
> CONFIG_SPARSEMEM_CLASSIC there when CONFIG_SPARSEMEM is enabled. This
> preserves the existing behavior.
>
> Signed-off-by: Kaitao Cheng <chengkaitao@xxxxxxxxxx>

Acked-by: Muchun Song <muchun.song@xxxxxxxxx>

Thanks.