Subject: Re: [PATCH 1/2] ARM: Remove redundant ARCH_SPARSEMEM_DEFAULT setting

From: Russell King - ARM Linux admin <[email-masked]>
Date: Thu, 7 May 2020 11:30:39 +0100

On Wed, May 06, 2020 at 04:50:08PM -0700, Florian Fainelli wrote:
> From: Kevin Cernekee <[email-masked]>
> 
> If ARCH_SPARSEMEM_ENABLE=y and ARCH_{FLATMEM,DISCONTIGMEM}_ENABLE=n,
> then the logic in mm/Kconfig already makes CONFIG_SPARSEMEM the only
> choice.  This is true for all of the existing ARM users of
> ARCH_SPARSEMEM_ENABLE.
> 
> Forcing ARCH_SPARSEMEM_DEFAULT=y if ARCH_SPARSEMEM_ENABLE=y prevents
> us from ever defaulting to FLATMEM, so we should remove this setting.

No explanation why that is desirable.

> -config ARCH_SPARSEMEM_DEFAULT
> -	def_bool ARCH_SPARSEMEM_ENABLE
> -

What this basically says is ARCH_SPARSEMEM_ENABLE=ARCH_SPARSEMEM_DEFAULT,
which is exactly what we want for the non-multiplatform boards that
select ARCH_SPARSEMEM_ENABLE - we _want_ them to default to sparsemem
because that is what the platform requires.

For example, with RiscPC, which selects ARCH_SPARSEMEM_ENABLE, we have
four banks of memory at 0x10000000, 0x14000000, 0x18000000 and
0x1c000000.  These correspond with the two memory slots - the first two
for the first slot, and the second two for the second slot.  Each slot
has two banks.  The size of each memory bank depends on the size of the
module.

Flatmem is completely unable to work with this setup if all banks are
populated, and the first bank does not contain enough memory to allocate
the struct page array.  So, sparsemem is the only option there.

Hence, for these platforms, we want sparsemem and only sparsemem, not
flatmem.

So, this patch which makes it possible to select flatmem is completely
out of the question for these platforms.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 10.2Mbps down 587kbps up

_______________________________________________
linux-arm-kernel mailing list
[email-masked]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel