Re: [PATCH] mm: Add CONFIG_SPARSEMEM_CLASSIC

From: David Hildenbrand (Arm)

Date: Mon Sep 21 2026 - 06:39:10 EST


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.

--
Cheers,

David