[PATCH 8/9] mm: replace CONFIG_NEED_MULTIPLE_NODES with CONFIG_NUMA

2021-06-02 Thread Mike Rapoport
From: Mike Rapoport 

After removal of DISCINTIGMEM the NEED_MULTIPLE_NODES and NUMA
configuration options are equivalent.

Drop CONFIG_NEED_MULTIPLE_NODES and use CONFIG_NUMA instead.

Done with

$ sed -i 's/CONFIG_NEED_MULTIPLE_NODES/CONFIG_NUMA/' \
$(git grep -wl CONFIG_NEED_MULTIPLE_NODES)
$ sed -i 's/NEED_MULTIPLE_NODES/NUMA/' \
$(git grep -wl NEED_MULTIPLE_NODES)

with manual tweaks afterwards.

Signed-off-by: Mike Rapoport 
---
 arch/arm64/Kconfig|  2 +-
 arch/ia64/Kconfig |  2 +-
 arch/mips/Kconfig |  2 +-
 arch/mips/include/asm/mmzone.h|  2 +-
 arch/mips/include/asm/page.h  |  2 +-
 arch/mips/mm/init.c   |  4 ++--
 arch/powerpc/Kconfig  |  2 +-
 arch/powerpc/include/asm/mmzone.h |  4 ++--
 arch/powerpc/kernel/setup_64.c|  2 +-
 arch/powerpc/kernel/smp.c |  2 +-
 arch/powerpc/kexec/core.c |  4 ++--
 arch/powerpc/mm/Makefile  |  2 +-
 arch/powerpc/mm/mem.c |  4 ++--
 arch/riscv/Kconfig|  2 +-
 arch/s390/Kconfig |  2 +-
 arch/sh/include/asm/mmzone.h  |  4 ++--
 arch/sh/kernel/topology.c |  2 +-
 arch/sh/mm/Kconfig|  2 +-
 arch/sh/mm/init.c |  2 +-
 arch/sparc/Kconfig|  2 +-
 arch/sparc/include/asm/mmzone.h   |  4 ++--
 arch/sparc/kernel/smp_64.c|  2 +-
 arch/sparc/mm/init_64.c   | 12 ++--
 arch/x86/Kconfig  |  2 +-
 arch/x86/kernel/setup_percpu.c|  6 +++---
 arch/x86/mm/init_32.c |  4 ++--
 include/asm-generic/topology.h|  2 +-
 include/linux/memblock.h  |  6 +++---
 include/linux/mm.h|  4 ++--
 include/linux/mmzone.h|  8 
 kernel/crash_core.c   |  2 +-
 mm/Kconfig|  9 -
 mm/memblock.c |  8 
 mm/page_alloc.c   |  6 +++---
 34 files changed, 58 insertions(+), 67 deletions(-)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 9f1d8566bbf9..d01a1545ab8f 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -1035,7 +1035,7 @@ config NODES_SHIFT
int "Maximum NUMA Nodes (as a power of 2)"
range 1 10
default "4"
-   depends on NEED_MULTIPLE_NODES
+   depends on NUMA
help
  Specify the maximum number of NUMA Nodes available on the target
  system.  Increases memory reserved to accommodate various tables.
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 279252e3e0f7..da22a35e6f03 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -302,7 +302,7 @@ config NODES_SHIFT
int "Max num nodes shift(3-10)"
range 3 10
default "10"
-   depends on NEED_MULTIPLE_NODES
+   depends on NUMA
help
  This option specifies the maximum number of nodes in your SSI system.
  MAX_NUMNODES will be 2^(This value).
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index ed51970c08e7..4704a16c2e44 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -2867,7 +2867,7 @@ config RANDOMIZE_BASE_MAX_OFFSET
 config NODES_SHIFT
int
default "6"
-   depends on NEED_MULTIPLE_NODES
+   depends on NUMA
 
 config HW_PERF_EVENTS
bool "Enable hardware performance counter support for perf events"
diff --git a/arch/mips/include/asm/mmzone.h b/arch/mips/include/asm/mmzone.h
index 7649ab45e80c..602a21aee9d4 100644
--- a/arch/mips/include/asm/mmzone.h
+++ b/arch/mips/include/asm/mmzone.h
@@ -8,7 +8,7 @@
 
 #include 
 
-#ifdef CONFIG_NEED_MULTIPLE_NODES
+#ifdef CONFIG_NUMA
 # include 
 #endif
 
diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h
index 195ff4e9771f..96bc798c1ec1 100644
--- a/arch/mips/include/asm/page.h
+++ b/arch/mips/include/asm/page.h
@@ -239,7 +239,7 @@ static inline int pfn_valid(unsigned long pfn)
 
 /* pfn_valid is defined in linux/mmzone.h */
 
-#elif defined(CONFIG_NEED_MULTIPLE_NODES)
+#elif defined(CONFIG_NUMA)
 
 #define pfn_valid(pfn) \
 ({ \
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index 97f6ca341448..19347dc6bbf8 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -394,7 +394,7 @@ void maar_init(void)
}
 }
 
-#ifndef CONFIG_NEED_MULTIPLE_NODES
+#ifndef CONFIG_NUMA
 void __init paging_init(void)
 {
unsigned long max_zone_pfns[MAX_NR_ZONES];
@@ -473,7 +473,7 @@ void __init mem_init(void)
0x8000 - 4, KCORE_TEXT);
 #endif
 }
-#endif /* !CONFIG_NEED_MULTIPLE_NODES */
+#endif /* !CONFIG_NUMA */
 
 void free_init_pages(const char *what, unsigned long begin, unsigned long end)
 {
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 088dd2afcfe4..14b132cf95e2 100644
--- a/arch/powerpc/Kconfig
+++ b/

Re: [PATCH 8/9] mm: replace CONFIG_NEED_MULTIPLE_NODES with CONFIG_NUMA

2021-06-09 Thread David Hildenbrand

On 02.06.21 12:53, Mike Rapoport wrote:

From: Mike Rapoport 

After removal of DISCINTIGMEM the NEED_MULTIPLE_NODES and NUMA
configuration options are equivalent.

Drop CONFIG_NEED_MULTIPLE_NODES and use CONFIG_NUMA instead.

Done with

$ sed -i 's/CONFIG_NEED_MULTIPLE_NODES/CONFIG_NUMA/' \
$(git grep -wl CONFIG_NEED_MULTIPLE_NODES)
$ sed -i 's/NEED_MULTIPLE_NODES/NUMA/' \
$(git grep -wl NEED_MULTIPLE_NODES)

with manual tweaks afterwards.

Signed-off-by: Mike Rapoport 
---
  arch/arm64/Kconfig|  2 +-
  arch/ia64/Kconfig |  2 +-
  arch/mips/Kconfig |  2 +-
  arch/mips/include/asm/mmzone.h|  2 +-
  arch/mips/include/asm/page.h  |  2 +-
  arch/mips/mm/init.c   |  4 ++--
  arch/powerpc/Kconfig  |  2 +-
  arch/powerpc/include/asm/mmzone.h |  4 ++--
  arch/powerpc/kernel/setup_64.c|  2 +-
  arch/powerpc/kernel/smp.c |  2 +-
  arch/powerpc/kexec/core.c |  4 ++--
  arch/powerpc/mm/Makefile  |  2 +-
  arch/powerpc/mm/mem.c |  4 ++--
  arch/riscv/Kconfig|  2 +-
  arch/s390/Kconfig |  2 +-
  arch/sh/include/asm/mmzone.h  |  4 ++--
  arch/sh/kernel/topology.c |  2 +-
  arch/sh/mm/Kconfig|  2 +-
  arch/sh/mm/init.c |  2 +-
  arch/sparc/Kconfig|  2 +-
  arch/sparc/include/asm/mmzone.h   |  4 ++--
  arch/sparc/kernel/smp_64.c|  2 +-
  arch/sparc/mm/init_64.c   | 12 ++--
  arch/x86/Kconfig  |  2 +-
  arch/x86/kernel/setup_percpu.c|  6 +++---
  arch/x86/mm/init_32.c |  4 ++--
  include/asm-generic/topology.h|  2 +-
  include/linux/memblock.h  |  6 +++---
  include/linux/mm.h|  4 ++--
  include/linux/mmzone.h|  8 
  kernel/crash_core.c   |  2 +-
  mm/Kconfig|  9 -
  mm/memblock.c |  8 
  mm/page_alloc.c   |  6 +++---
  34 files changed, 58 insertions(+), 67 deletions(-)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 9f1d8566bbf9..d01a1545ab8f 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -1035,7 +1035,7 @@ config NODES_SHIFT
int "Maximum NUMA Nodes (as a power of 2)"
range 1 10
default "4"
-   depends on NEED_MULTIPLE_NODES
+   depends on NUMA
help
  Specify the maximum number of NUMA Nodes available on the target
  system.  Increases memory reserved to accommodate various tables.
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 279252e3e0f7..da22a35e6f03 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -302,7 +302,7 @@ config NODES_SHIFT
int "Max num nodes shift(3-10)"
range 3 10
default "10"
-   depends on NEED_MULTIPLE_NODES
+   depends on NUMA
help
  This option specifies the maximum number of nodes in your SSI system.
  MAX_NUMNODES will be 2^(This value).
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index ed51970c08e7..4704a16c2e44 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -2867,7 +2867,7 @@ config RANDOMIZE_BASE_MAX_OFFSET
  config NODES_SHIFT
int
default "6"
-   depends on NEED_MULTIPLE_NODES
+   depends on NUMA
  
  config HW_PERF_EVENTS

bool "Enable hardware performance counter support for perf events"
diff --git a/arch/mips/include/asm/mmzone.h b/arch/mips/include/asm/mmzone.h
index 7649ab45e80c..602a21aee9d4 100644
--- a/arch/mips/include/asm/mmzone.h
+++ b/arch/mips/include/asm/mmzone.h
@@ -8,7 +8,7 @@
  
  #include 
  
-#ifdef CONFIG_NEED_MULTIPLE_NODES

+#ifdef CONFIG_NUMA
  # include 
  #endif
  
diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h

index 195ff4e9771f..96bc798c1ec1 100644
--- a/arch/mips/include/asm/page.h
+++ b/arch/mips/include/asm/page.h
@@ -239,7 +239,7 @@ static inline int pfn_valid(unsigned long pfn)
  
  /* pfn_valid is defined in linux/mmzone.h */
  
-#elif defined(CONFIG_NEED_MULTIPLE_NODES)

+#elif defined(CONFIG_NUMA)
  
  #define pfn_valid(pfn)			\

  ({\
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index 97f6ca341448..19347dc6bbf8 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -394,7 +394,7 @@ void maar_init(void)
}
  }
  
-#ifndef CONFIG_NEED_MULTIPLE_NODES

+#ifndef CONFIG_NUMA
  void __init paging_init(void)
  {
unsigned long max_zone_pfns[MAX_NR_ZONES];
@@ -473,7 +473,7 @@ void __init mem_init(void)
0x8000 - 4, KCORE_TEXT);
  #endif
  }
-#endif /* !CONFIG_NEED_MULTIPLE_NODES */
+#endif /* !CONFIG_NUMA */
  
  void free_init_pages(const char *what, unsigned long begin, unsigned long end)

  {
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 08