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

From: Mike Rapoport <[email-masked]>
Date: Sat, 9 May 2020 00:41:49 +0300

On Thu, May 07, 2020 at 01:47:57PM -0700, Florian Fainelli wrote:
> 
> On 5/7/2020 1:29 PM, Mike Rapoport wrote:

...

> > If I understood Florian's intention correctly, the goal was to allow
> > manual selection of the memory model for multiplatform builds that today
> > implicitly use flatmem.
> 
> That is correct.
> 
> > 
> > I think that the patch below would achieve that without changing the
> > current defaults and without forcing flatmem on the platforms that
> > already explicitly select sparsemem.
> 
> Agree, with your patch, we have the following:
> 
> mutli_v7_defonfig -> FLATMEM
> ep93xx_defconfig -> SPARSEMEM
> rpc_defconfig -> SPARSEMEM
> assabet_defconfig -> SPARSEMEM
> 
> with the bonus that when you run menuconfig you can now select sparsemem
> for a multi-platform build, which was the intention.

If there is a need to use sparsemem for the multiplatform build, then
maybe we should consider moving to sparsemem?

The increase in size for the defconfig build is about 7k and some of if
is accounted for the .init code and data:

   text    data     bss     dec     hex filename
14539957        7461462  413288 22414707        1560573 vmlinux-flatmem
14545233        7461762  415400 22422395        156237b vmlinux-sparse-static

I don't have ARM hardware, so I cannot measure the run-time effect though. 

> Tested-by: Florian Fainelli <[email-masked]>
 
Thanks!

> > 
> > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> > index 66a04f6f4775..b6eb1a28ca27 100644
> > --- a/arch/arm/Kconfig
> > +++ b/arch/arm/Kconfig
> > @@ -312,6 +312,9 @@ choice
> >  config ARCH_MULTIPLATFORM
> >  	bool "Allow multiple platforms to be selected"
> >  	depends on MMU
> > +	select ARCH_FLATMEM_ENABLE
> > +	select ARCH_SPARSEMEM_ENABLE
> > +	select ARCH_SELECT_MEMORY_MODEL
> >  	select ARM_HAS_SG_CHAIN
> >  	select ARM_PATCH_PHYS_VIRT
> >  	select AUTO_ZRELADDR
> > @@ -1515,11 +1518,14 @@ config OABI_COMPAT
> >  config ARCH_HAS_HOLES_MEMORYMODEL
> >  	bool
> >  
> > +config ARCH_FLATMEM_ENABLE
> > +	bool
> > +
> >  config ARCH_SPARSEMEM_ENABLE
> >  	bool
> >  
> > -config ARCH_SPARSEMEM_DEFAULT
> > -	def_bool ARCH_SPARSEMEM_ENABLE
> > +config ARCH_SELECT_MEMORY_MODEL
> > +	bool
> >  
> >  config HAVE_ARCH_PFN_VALID
> >  	def_bool ARCH_HAS_HOLES_MEMORYMODEL || !SPARSEMEM
> > 
> >> -- 
> >> 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
> > 
> 
> -- 
> Florian

-- 
Sincerely yours,
Mike.

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