2019-05-01 19:57:41

by Mike Rapoport

[permalink] [raw]
Subject: [PATCH 0/3] remove ARCH_SELECT_MEMORY_MODEL where it has no effect

Hi,

For several architectures the ARCH_SELECT_MEMORY_MODEL has no real effect
because the dependencies for the memory model are always evaluated to a
single value.

Remove the ARCH_SELECT_MEMORY_MODEL from the Kconfigs for these
architectures.

Mike Rapoport (3):
arm: remove ARCH_SELECT_MEMORY_MODEL
s390: remove ARCH_SELECT_MEMORY_MODEL
sparc: remove ARCH_SELECT_MEMORY_MODEL

arch/arm/Kconfig | 3 ---
arch/s390/Kconfig | 3 ---
arch/sparc/Kconfig | 3 ---
3 files changed, 9 deletions(-)

--
2.7.4


2019-05-01 19:57:51

by Mike Rapoport

[permalink] [raw]
Subject: [PATCH 1/3] arm: remove ARCH_SELECT_MEMORY_MODEL

The ARCH_SELECT_MEMORY_MODEL in arch/arm/Kconfig is enabled only when
ARCH_SPARSEMEM_ENABLE=y. But in this case, ARCH_SPARSEMEM_DEFAULT is also
enabled and this in turn enables SPARSEMEM_MANUAL.

Since there is no definition of ARCH_FLATMEM_ENABLE in arch/arm/Kconfig,
SPARSEMEM_MANUAL is the only enabled memory model, hence the final
selection will evaluate to SPARSEMEM=y.

Since ARCH_SPARSEMEM_ENABLE is set to 'y' only by several sub-arch
configurations, the default for must sub-arches would be the falback to
FLATMEM regardless of ARCH_SELECT_MEMORY_MODEL.

Signed-off-by: Mike Rapoport <[email protected]>
---
arch/arm/Kconfig | 3 ---
1 file changed, 3 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 9aed25a..25a69a3 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1592,9 +1592,6 @@ config ARCH_SPARSEMEM_ENABLE
config ARCH_SPARSEMEM_DEFAULT
def_bool ARCH_SPARSEMEM_ENABLE

-config ARCH_SELECT_MEMORY_MODEL
- def_bool ARCH_SPARSEMEM_ENABLE
-
config HAVE_ARCH_PFN_VALID
def_bool ARCH_HAS_HOLES_MEMORYMODEL || !SPARSEMEM

--
2.7.4

2019-05-01 19:58:52

by Mike Rapoport

[permalink] [raw]
Subject: [PATCH 3/3] sparc: remove ARCH_SELECT_MEMORY_MODEL

The ARCH_SELECT_MEMORY_MODEL option is enabled only for 64-bit. However,
64-bit configuration also enables ARCH_SPARSEMEM_DEFAULT and there is no
ARCH_FLATMEM_ENABLE in arch/sparc/Kconfig.

With such settings, the dependencies in mm/Kconfig are always evaluated to
SPARSEMEM=y for 64-bit and to FLATMEM=y for 32-bit.

The ARCH_SELECT_MEMORY_MODEL option in arch/sparc/Kconfig does not affect
anything and can be removed.

Signed-off-by: Mike Rapoport <[email protected]>
---
arch/sparc/Kconfig | 3 ---
1 file changed, 3 deletions(-)

diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index 40f8f4f..9137dbe 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -305,9 +305,6 @@ config NODES_SPAN_OTHER_NODES
def_bool y
depends on NEED_MULTIPLE_NODES

-config ARCH_SELECT_MEMORY_MODEL
- def_bool y if SPARC64
-
config ARCH_SPARSEMEM_ENABLE
def_bool y if SPARC64
select SPARSEMEM_VMEMMAP_ENABLE
--
2.7.4

2019-05-01 19:59:23

by Mike Rapoport

[permalink] [raw]
Subject: [PATCH 2/3] s390: remove ARCH_SELECT_MEMORY_MODEL

The only reason s390 has ARCH_SELECT_MEMORY_MODEL option in
arch/s390/Kconfig is an ancient compile error with allnoconfig which was
fixed by commit 97195d6b411f ("[S390] fix sparsemem related compile error
with allnoconfig on s390") by adding the ARCH_SELECT_MEMORY_MODEL option.

Since then a lot have changed and now allnoconfig builds just fine without
ARCH_SELECT_MEMORY_MODEL, so it can be removed.

Signed-off-by: Mike Rapoport <[email protected]>
---
arch/s390/Kconfig | 3 ---
1 file changed, 3 deletions(-)

diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index b6e3d06..69d3956 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -621,9 +621,6 @@ config ARCH_SPARSEMEM_ENABLE
config ARCH_SPARSEMEM_DEFAULT
def_bool y

-config ARCH_SELECT_MEMORY_MODEL
- def_bool y
-
config ARCH_ENABLE_MEMORY_HOTPLUG
def_bool y if SPARSEMEM

--
2.7.4

2019-05-03 15:24:12

by Heiko Carstens

[permalink] [raw]
Subject: Re: [PATCH 2/3] s390: remove ARCH_SELECT_MEMORY_MODEL

On Wed, May 01, 2019 at 10:56:16PM +0300, Mike Rapoport wrote:
> The only reason s390 has ARCH_SELECT_MEMORY_MODEL option in
> arch/s390/Kconfig is an ancient compile error with allnoconfig which was
> fixed by commit 97195d6b411f ("[S390] fix sparsemem related compile error
> with allnoconfig on s390") by adding the ARCH_SELECT_MEMORY_MODEL option.
>
> Since then a lot have changed and now allnoconfig builds just fine without
> ARCH_SELECT_MEMORY_MODEL, so it can be removed.
>
> Signed-off-by: Mike Rapoport <[email protected]>
> ---
> arch/s390/Kconfig | 3 ---
> 1 file changed, 3 deletions(-)

Acked-by: Heiko Carstens <[email protected]>

2019-05-16 05:20:52

by Mike Rapoport

[permalink] [raw]
Subject: Re: [PATCH 0/3] remove ARCH_SELECT_MEMORY_MODEL where it has no effect

Andrew,

Can this go via the -mm tree?

On Wed, May 01, 2019 at 10:56:14PM +0300, Mike Rapoport wrote:
> Hi,
>
> For several architectures the ARCH_SELECT_MEMORY_MODEL has no real effect
> because the dependencies for the memory model are always evaluated to a
> single value.
>
> Remove the ARCH_SELECT_MEMORY_MODEL from the Kconfigs for these
> architectures.
>
> Mike Rapoport (3):
> arm: remove ARCH_SELECT_MEMORY_MODEL
> s390: remove ARCH_SELECT_MEMORY_MODEL
> sparc: remove ARCH_SELECT_MEMORY_MODEL
>
> arch/arm/Kconfig | 3 ---
> arch/s390/Kconfig | 3 ---
> arch/sparc/Kconfig | 3 ---
> 3 files changed, 9 deletions(-)
>
> --
> 2.7.4
>

--
Sincerely yours,
Mike.