Skip to contentSkip to conversation

remove ARCH_SELECT_MEMORY_MODEL where it has no effect

PATCH In review Mike Rapoport 2 participants 6 messages May 1, 2019 – May 16, 2019

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover 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(-)
Signature · 1 line
2.7.4
#1 lore raw

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.

---
 arch/arm/Kconfig | 3 ---
 1 file changed, 3 deletions(-)
arch/arm/Kconfig +0 -3
index 9aed25a..25a69a3 100644
@@ -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
 
Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/3 s390: remove ARCH_SELECT_MEMORY_MODEL

In reply to Mike Rapoport

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.

---
 arch/s390/Kconfig | 3 ---
 1 file changed, 3 deletions(-)
arch/s390/Kconfig +0 -3
index b6e3d06..69d3956 100644
@@ -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
 
Signature · 1 line
2.7.4
Acked-by on v1 2/3
#3 lore raw

Re: [PATCH 2/3] s390: remove ARCH_SELECT_MEMORY_MODEL

Quoted 5 lines · Mike Rapoport

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.

Quoted 7 lines

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

---
 arch/s390/Kconfig | 3 ---
 1 file changed, 3 deletions(-)
#4 lore raw

PATCH 3/3 sparc: remove ARCH_SELECT_MEMORY_MODEL

In reply to Mike Rapoport

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.

---
 arch/sparc/Kconfig | 3 ---
 1 file changed, 3 deletions(-)
arch/sparc/Kconfig +0 -3
index 40f8f4f..9137dbe 100644
@@ -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
Signature · 1 line
2.7.4
#5 lore raw
In reply to Mike Rapoport

Andrew,

Can this go via the -mm tree?

Quoted 22 lines · Mike Rapoport

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(-)
Signature · 1 line
2.7.4
Signature · 2 lines
Sincerely yours,
Mike.