The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v3 00/10] sh: remove NUMA and SPARSEMEM support
@ 2026-07-02  9:37 Mike Rapoport (Microsoft)
  2026-07-02  9:37 ` [PATCH v3 01/10] sh: remove CONFIG_NUMA and realted configuration options Mike Rapoport (Microsoft)
                   ` (10 more replies)
  0 siblings, 11 replies; 15+ messages in thread
From: Mike Rapoport (Microsoft) @ 2026-07-02  9:37 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Arnd Bergmann, John Paul Adrian Glaubitz, Mike Rapoport,
	Rich Felker, Yoshinori Sato, linux-sh, linux-kernel, linux-mm

Hi,

NUMA support for SuperH was introduced a long time ago by commit
b241cb0c885e ("sh: Support for multiple nodes.")

        "... for boards with many different memory blocks that are
         otherwise unused (SH7722/SH7785 URAM and so forth)"

In reality, this added 128K of memory on sh7722 and sh7785 and 256K on
shx3 at the expense of all the NUMA related code in the kernel.

For build of v7.0-rc7 with defconfig and the same configuration with
CONFIG_NUMA disabled, bloat-o-meter reports difference of ~76k. Disabling
CONFIG_SPARSMEM on top increases the difference to ~94k. And that's only
overhead in code and static data that does not take into the account data
structures allocated at run time.

And all this overhead has been there for nothing for almost 8 years
because since commit ac21fc2dcb40 ("sh: switch to NO_BOOTMEM")
those additional "nodes" could not be used by the core MM because the
maximal pfn for ZONE_NORMAL was cut out at the end of the normal memory.

---
It's been another few weeks without updates from Adrian and I don't see
why it should wait more.

@Andrew, please take it to the mm tree.

v3 changes:
* rebased on v7.2-rc1

v2: https://patch.msgid.link/20260510135546.13554-1-rppt@kernel.org
* remove stale SYS_SUPPORTS_NUMA
* add Arnd's Reviewed-by

v1: https://patch.msgid.link/20260510135546.13554-1-rppt@kernel.org

---
Mike Rapoport (Microsoft) (10):
      sh: remove CONFIG_NUMA and realted configuration options
      sh: mm: remove numa.c
      sh: mm: drop allocate_pgdat()
      sh: remove setup_bootmem_node() and plat_mem_setup()
      sh: drop dead code guarded by #ifdef CONFIG_NUMA
      sh: drop include/asm/mmzone.h
      init/Kconfig: drop ARCH_WANT_NUMA_VARIABLE_LOCALITY
      sh: init: remove call the memblock_set_node()
      sh: remove SPARSEMEM related entries from Kconfig
      sh: drop include/asm/sparsemem.h

 arch/sh/Kconfig                        | 12 --------
 arch/sh/configs/migor_defconfig        |  1 -
 arch/sh/configs/sdk7786_defconfig      |  1 -
 arch/sh/configs/se7722_defconfig       |  1 -
 arch/sh/configs/shx3_defconfig         |  1 -
 arch/sh/configs/ul2_defconfig          |  1 -
 arch/sh/include/asm/mmu.h              |  2 ++
 arch/sh/include/asm/mmzone.h           | 42 ---------------------------
 arch/sh/include/asm/setup.h            |  3 ++
 arch/sh/include/asm/sparsemem.h        | 12 --------
 arch/sh/include/asm/topology.h         | 13 ---------
 arch/sh/kernel/cpu/sh4a/setup-sh7366.c |  5 ----
 arch/sh/kernel/cpu/sh4a/setup-sh7722.c |  7 -----
 arch/sh/kernel/cpu/sh4a/setup-sh7723.c |  1 -
 arch/sh/kernel/cpu/sh4a/setup-sh7724.c |  1 -
 arch/sh/kernel/cpu/sh4a/setup-sh7757.c |  5 ----
 arch/sh/kernel/cpu/sh4a/setup-sh7785.c |  7 -----
 arch/sh/kernel/cpu/sh4a/setup-sh7786.c |  5 ----
 arch/sh/kernel/cpu/sh4a/setup-shx3.c   | 18 ------------
 arch/sh/kernel/setup.c                 |  7 -----
 arch/sh/kernel/topology.c              | 12 --------
 arch/sh/kernel/vmcore_info.c           |  4 ---
 arch/sh/mm/Kconfig                     | 29 -------------------
 arch/sh/mm/Makefile                    |  1 -
 arch/sh/mm/init.c                      | 24 ---------------
 arch/sh/mm/numa.c                      | 53 ----------------------------------
 arch/sh/mm/sram.c                      |  3 +-
 init/Kconfig                           |  7 -----
 28 files changed, 6 insertions(+), 272 deletions(-)
---
base-commit: dc59e4fea9d83f03bad6bddf3fa2e52491777482
change-id: 20260702-sh-numa-v2-91b86e3901b4

--
Sincerely yours,
Mike.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH v3 01/10] sh: remove CONFIG_NUMA and realted configuration options
  2026-07-02  9:37 [PATCH v3 00/10] sh: remove NUMA and SPARSEMEM support Mike Rapoport (Microsoft)
@ 2026-07-02  9:37 ` Mike Rapoport (Microsoft)
  2026-07-02  9:37 ` [PATCH v3 02/10] sh: mm: remove numa.c Mike Rapoport (Microsoft)
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: Mike Rapoport (Microsoft) @ 2026-07-02  9:37 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Arnd Bergmann, John Paul Adrian Glaubitz, Mike Rapoport,
	Rich Felker, Yoshinori Sato, linux-sh, linux-kernel, linux-mm

NUMA support for SuperH was introduced a long time ago by commit
b241cb0c885e ("sh: Support for multiple nodes.")

	"... for boards with many different memory blocks that are
	 otherwise unused (SH7722/SH7785 URAM and so forth)"

In reality, this added 128K of memory on sh7722 and sh7785 and 256K on
shx3 at the expense of all the NUMA related code in the kernel.

For build of v7.0-rc7 with defconfig and the same configuration with
CONFIG_NUMA disabled, bloat-o-meter reports difference of ~76k. Disabling
CONFIG_SPARSMEM on top increases the difference to ~94k. And that's only
overhead in code and static data that does not take into the account data
structures allocated at run time.

And all this overhead has been there for nothing for almost 8 years
because since commit ac21fc2dcb40 ("sh: switch to NO_BOOTMEM")
those additional "nodes" could not be used by the core MM because the
maximal pfn for ZONE_NORMAL was cut out at the end of the normal memory.

Start removing NUMA support on sh with removing CONFIG_NUMA and related
configuration options in arch/sh/Kconfig and arch/sh/mm/Kconfig.

Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
---
 arch/sh/Kconfig                   |  6 ------
 arch/sh/configs/migor_defconfig   |  1 -
 arch/sh/configs/sdk7786_defconfig |  1 -
 arch/sh/configs/se7722_defconfig  |  1 -
 arch/sh/configs/shx3_defconfig    |  1 -
 arch/sh/configs/ul2_defconfig     |  1 -
 arch/sh/mm/Kconfig                | 19 -------------------
 7 files changed, 30 deletions(-)

diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index d5795067befa..d0ba91eba71a 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -106,9 +106,6 @@ config SYS_SUPPORTS_APM_EMULATION
 config SYS_SUPPORTS_SMP
 	bool
 
-config SYS_SUPPORTS_NUMA
-	bool
-
 config STACKTRACE_SUPPORT
 	def_bool y
 
@@ -197,7 +194,6 @@ config CPU_SHX3
 	bool
 	select DMA_COHERENT
 	select SYS_SUPPORTS_SMP
-	select SYS_SUPPORTS_NUMA
 
 config ARCH_SHMOBILE
 	bool
@@ -443,7 +439,6 @@ config CPU_SUBTYPE_SH7785
 	select CPU_SH4A
 	select CPU_SHX2
 	select ARCH_SPARSEMEM_ENABLE
-	select SYS_SUPPORTS_NUMA
 	select PINCTRL
 
 config CPU_SUBTYPE_SH7786
@@ -478,7 +473,6 @@ config CPU_SUBTYPE_SH7722
 	select CPU_SHX2
 	select ARCH_SHMOBILE
 	select ARCH_SPARSEMEM_ENABLE
-	select SYS_SUPPORTS_NUMA
 	select SYS_SUPPORTS_SH_CMT
 	select PINCTRL
 
diff --git a/arch/sh/configs/migor_defconfig b/arch/sh/configs/migor_defconfig
index 1d9d543eef4c..db993616f14e 100644
--- a/arch/sh/configs/migor_defconfig
+++ b/arch/sh/configs/migor_defconfig
@@ -9,7 +9,6 @@ CONFIG_MODULES=y
 # CONFIG_BLK_DEV_BSG is not set
 CONFIG_CPU_SUBTYPE_SH7722=y
 CONFIG_MEMORY_START=0x0c000000
-CONFIG_NUMA=y
 # CONFIG_MIGRATION is not set
 CONFIG_SH_MIGOR=y
 # CONFIG_SH_TIMER_CMT is not set
diff --git a/arch/sh/configs/sdk7786_defconfig b/arch/sh/configs/sdk7786_defconfig
index d6fa3a422e24..36e6dd0622f7 100644
--- a/arch/sh/configs/sdk7786_defconfig
+++ b/arch/sh/configs/sdk7786_defconfig
@@ -41,7 +41,6 @@ CONFIG_CPU_SUBTYPE_SH7786=y
 CONFIG_MEMORY_START=0x40000000
 CONFIG_MEMORY_SIZE=0x20000000
 CONFIG_PMB=y
-CONFIG_NUMA=y
 CONFIG_HUGETLB_PAGE_SIZE_64MB=y
 CONFIG_KSM=y
 CONFIG_SH_STORE_QUEUES=y
diff --git a/arch/sh/configs/se7722_defconfig b/arch/sh/configs/se7722_defconfig
index 85b8eb013b79..2908611b118e 100644
--- a/arch/sh/configs/se7722_defconfig
+++ b/arch/sh/configs/se7722_defconfig
@@ -10,7 +10,6 @@ CONFIG_MODULE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
 CONFIG_CPU_SUBTYPE_SH7722=y
 CONFIG_MEMORY_START=0x0c000000
-CONFIG_NUMA=y
 CONFIG_SH_STORE_QUEUES=y
 CONFIG_SH_7722_SOLUTION_ENGINE=y
 # CONFIG_SH_TIMER_CMT is not set
diff --git a/arch/sh/configs/shx3_defconfig b/arch/sh/configs/shx3_defconfig
index 0cb69a0b92cb..22c242cf89f7 100644
--- a/arch/sh/configs/shx3_defconfig
+++ b/arch/sh/configs/shx3_defconfig
@@ -29,7 +29,6 @@ CONFIG_MODULE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
 CONFIG_CPU_SUBTYPE_SHX3=y
 CONFIG_MEMORY_START=0x0c000000
-CONFIG_NUMA=y
 CONFIG_PAGE_SIZE_64KB=y
 CONFIG_SH_STORE_QUEUES=y
 CONFIG_SH_X3PROTO=y
diff --git a/arch/sh/configs/ul2_defconfig b/arch/sh/configs/ul2_defconfig
index 00a37944b043..1740a6465280 100644
--- a/arch/sh/configs/ul2_defconfig
+++ b/arch/sh/configs/ul2_defconfig
@@ -10,7 +10,6 @@ CONFIG_MODULE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
 CONFIG_CPU_SUBTYPE_SH7366=y
 CONFIG_MEMORY_SIZE=0x01f00000
-CONFIG_NUMA=y
 # CONFIG_MIGRATION is not set
 # CONFIG_SH_DSP is not set
 # CONFIG_SH_TIMER_CMT is not set
diff --git a/arch/sh/mm/Kconfig b/arch/sh/mm/Kconfig
index 1862411665ab..71fecbbb080e 100644
--- a/arch/sh/mm/Kconfig
+++ b/arch/sh/mm/Kconfig
@@ -112,27 +112,8 @@ config VSYSCALL
 	  For systems with an MMU that can afford to give up a page,
 	  (the default value) say Y.
 
-config NUMA
-	bool "Non-Uniform Memory Access (NUMA) Support"
-	depends on MMU && SYS_SUPPORTS_NUMA
-	select ARCH_WANT_NUMA_VARIABLE_LOCALITY
-	default n
-	help
-	  Some SH systems have many various memories scattered around
-	  the address space, each with varying latencies. This enables
-	  support for these blocks by binding them to nodes and allowing
-	  memory policies to be used for prioritizing and controlling
-	  allocation behaviour.
-
-config NODES_SHIFT
-	int
-	default "3" if CPU_SUBTYPE_SHX3
-	default "1"
-	depends on NUMA
-
 config ARCH_FLATMEM_ENABLE
 	def_bool y
-	depends on !NUMA
 
 config ARCH_SPARSEMEM_ENABLE
 	def_bool y

-- 
2.53.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v3 02/10] sh: mm: remove numa.c
  2026-07-02  9:37 [PATCH v3 00/10] sh: remove NUMA and SPARSEMEM support Mike Rapoport (Microsoft)
  2026-07-02  9:37 ` [PATCH v3 01/10] sh: remove CONFIG_NUMA and realted configuration options Mike Rapoport (Microsoft)
@ 2026-07-02  9:37 ` Mike Rapoport (Microsoft)
  2026-07-02  9:37 ` [PATCH v3 03/10] sh: mm: drop allocate_pgdat() Mike Rapoport (Microsoft)
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: Mike Rapoport (Microsoft) @ 2026-07-02  9:37 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Arnd Bergmann, John Paul Adrian Glaubitz, Mike Rapoport,
	Rich Felker, Yoshinori Sato, linux-sh, linux-kernel, linux-mm

Since CONFIG_NUMA is removed, numa.c won't be ever compiled.

Remove it.

Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
---
 arch/sh/mm/Makefile |  1 -
 arch/sh/mm/numa.c   | 53 -----------------------------------------------------
 2 files changed, 54 deletions(-)

diff --git a/arch/sh/mm/Makefile b/arch/sh/mm/Makefile
index f69ddc70b146..7033947955d6 100644
--- a/arch/sh/mm/Makefile
+++ b/arch/sh/mm/Makefile
@@ -37,7 +37,6 @@ endif
 obj-$(CONFIG_DEBUG_FS)		+= $(debugfs-y)
 obj-$(CONFIG_HUGETLB_PAGE)	+= hugetlbpage.o
 obj-$(CONFIG_PMB)		+= pmb.o
-obj-$(CONFIG_NUMA)		+= numa.o
 obj-$(CONFIG_IOREMAP_FIXED)	+= ioremap_fixed.o
 obj-$(CONFIG_UNCACHED_MAPPING)	+= uncached.o
 obj-$(CONFIG_HAVE_SRAM_POOL)	+= sram.o
diff --git a/arch/sh/mm/numa.c b/arch/sh/mm/numa.c
deleted file mode 100644
index 9bc212b5e762..000000000000
--- a/arch/sh/mm/numa.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * arch/sh/mm/numa.c - Multiple node support for SH machines
- *
- *  Copyright (C) 2007  Paul Mundt
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-#include <linux/module.h>
-#include <linux/memblock.h>
-#include <linux/mm.h>
-#include <linux/numa.h>
-#include <linux/pfn.h>
-#include <asm/sections.h>
-
-/*
- * On SH machines the conventional approach is to stash system RAM
- * in node 0, and other memory blocks in to node 1 and up, ordered by
- * latency. Each node's pgdat is node-local at the beginning of the node,
- * immediately followed by the node mem map.
- */
-void __init setup_bootmem_node(int nid, unsigned long start, unsigned long end)
-{
-	unsigned long start_pfn, end_pfn;
-
-	/* Don't allow bogus node assignment */
-	BUG_ON(nid >= MAX_NUMNODES || nid <= 0);
-
-	start_pfn = PFN_DOWN(start);
-	end_pfn = PFN_DOWN(end);
-
-	pmb_bolt_mapping((unsigned long)__va(start), start, end - start,
-			 PAGE_KERNEL);
-
-	memblock_add(start, end - start);
-
-	__add_active_range(nid, start_pfn, end_pfn);
-
-	/* Node-local pgdat */
-	NODE_DATA(nid) = memblock_alloc_node(sizeof(struct pglist_data),
-					     SMP_CACHE_BYTES, nid);
-	if (!NODE_DATA(nid))
-		panic("%s: Failed to allocate %zu bytes align=0x%x nid=%d\n",
-		      __func__, sizeof(struct pglist_data), SMP_CACHE_BYTES,
-		      nid);
-
-	NODE_DATA(nid)->node_start_pfn = start_pfn;
-	NODE_DATA(nid)->node_spanned_pages = end_pfn - start_pfn;
-
-	/* It's up */
-	node_set_online(nid);
-}

-- 
2.53.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v3 03/10] sh: mm: drop allocate_pgdat()
  2026-07-02  9:37 [PATCH v3 00/10] sh: remove NUMA and SPARSEMEM support Mike Rapoport (Microsoft)
  2026-07-02  9:37 ` [PATCH v3 01/10] sh: remove CONFIG_NUMA and realted configuration options Mike Rapoport (Microsoft)
  2026-07-02  9:37 ` [PATCH v3 02/10] sh: mm: remove numa.c Mike Rapoport (Microsoft)
@ 2026-07-02  9:37 ` Mike Rapoport (Microsoft)
  2026-07-02  9:37 ` [PATCH v3 04/10] sh: remove setup_bootmem_node() and plat_mem_setup() Mike Rapoport (Microsoft)
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: Mike Rapoport (Microsoft) @ 2026-07-02  9:37 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Arnd Bergmann, John Paul Adrian Glaubitz, Mike Rapoport,
	Rich Felker, Yoshinori Sato, linux-sh, linux-kernel, linux-mm

allocate_pgdat() function used to allocate the node data structure and
initialize its node_start_pfn and node_spanned_pages fields.

Without CONFIG_NUMA there is no need to allocate the node data and
setting node_start_pfn and node_spanned_pages are redundant because they
are anyway overwritten later by core MM.

Remove allocate_pgdat() function.

Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
---
 arch/sh/mm/init.c | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c
index 110308bdef01..fb728906a83f 100644
--- a/arch/sh/mm/init.c
+++ b/arch/sh/mm/init.c
@@ -199,20 +199,6 @@ void __init page_table_range_init(unsigned long start, unsigned long end,
 }
 #endif	/* CONFIG_MMU */
 
-void __init allocate_pgdat(unsigned int nid)
-{
-	unsigned long start_pfn, end_pfn;
-
-	get_pfn_range_for_nid(nid, &start_pfn, &end_pfn);
-
-#ifdef CONFIG_NUMA
-	alloc_node_data(nid);
-#endif
-
-	NODE_DATA(nid)->node_start_pfn = start_pfn;
-	NODE_DATA(nid)->node_spanned_pages = end_pfn - start_pfn;
-}
-
 static void __init do_init_bootmem(void)
 {
 	unsigned long start_pfn, end_pfn;
@@ -222,8 +208,6 @@ static void __init do_init_bootmem(void)
 	for_each_mem_pfn_range(i, MAX_NUMNODES, &start_pfn, &end_pfn, NULL)
 		__add_active_range(0, start_pfn, end_pfn);
 
-	/* All of system RAM sits in node 0 for the non-NUMA case */
-	allocate_pgdat(0);
 	node_set_online(0);
 
 	plat_mem_setup();

-- 
2.53.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v3 04/10] sh: remove setup_bootmem_node() and plat_mem_setup()
  2026-07-02  9:37 [PATCH v3 00/10] sh: remove NUMA and SPARSEMEM support Mike Rapoport (Microsoft)
                   ` (2 preceding siblings ...)
  2026-07-02  9:37 ` [PATCH v3 03/10] sh: mm: drop allocate_pgdat() Mike Rapoport (Microsoft)
@ 2026-07-02  9:37 ` Mike Rapoport (Microsoft)
  2026-07-02  9:37 ` [PATCH v3 05/10] sh: drop dead code guarded by #ifdef CONFIG_NUMA Mike Rapoport (Microsoft)
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: Mike Rapoport (Microsoft) @ 2026-07-02  9:37 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Arnd Bergmann, John Paul Adrian Glaubitz, Mike Rapoport,
	Rich Felker, Yoshinori Sato, linux-sh, linux-kernel, linux-mm

setup_bootmem_node() and plat_mem_setup() were needed to setup NUMA "nodes"
for URAM memory ranges. Since there is no NUMA support anymore, these
functions are not needed.

Remove them.

Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
---
 arch/sh/kernel/cpu/sh4a/setup-sh7366.c |  5 -----
 arch/sh/kernel/cpu/sh4a/setup-sh7722.c |  6 ------
 arch/sh/kernel/cpu/sh4a/setup-sh7757.c |  4 ----
 arch/sh/kernel/cpu/sh4a/setup-sh7785.c |  6 ------
 arch/sh/kernel/cpu/sh4a/setup-sh7786.c |  4 ----
 arch/sh/kernel/cpu/sh4a/setup-shx3.c   | 17 -----------------
 arch/sh/mm/init.c                      |  7 -------
 7 files changed, 49 deletions(-)

diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7366.c b/arch/sh/kernel/cpu/sh4a/setup-sh7366.c
index 6676beef053e..0a4ceb9785f6 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7366.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7366.c
@@ -381,8 +381,3 @@ void __init plat_irq_setup(void)
 {
 	register_intc_controller(&intc_desc);
 }
-
-void __init plat_mem_setup(void)
-{
-	/* TODO: Register Node 1 */
-}
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
index 0c6757ef63f4..2180819a1455 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
@@ -658,9 +658,3 @@ void __init plat_irq_setup(void)
 {
 	register_intc_controller(&intc_desc);
 }
-
-void __init plat_mem_setup(void)
-{
-	/* Register the URAM space as Node 1 */
-	setup_bootmem_node(1, 0x055f0000, 0x05610000);
-}
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
index 2ad19a0c5e04..1f4396da00e5 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
@@ -1239,7 +1239,3 @@ void __init plat_irq_setup_pins(int mode)
 		BUG();
 	}
 }
-
-void __init plat_mem_setup(void)
-{
-}
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7785.c b/arch/sh/kernel/cpu/sh4a/setup-sh7785.c
index 3b4a414d60a9..95c3cc15a443 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7785.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7785.c
@@ -600,9 +600,3 @@ void __init plat_irq_setup_pins(int mode)
 		BUG();
 	}
 }
-
-void __init plat_mem_setup(void)
-{
-	/* Register the URAM space as Node 1 */
-	setup_bootmem_node(1, 0xe55f0000, 0xe5610000);
-}
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
index c048842d8a58..a46d6c3241a9 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
@@ -783,10 +783,6 @@ void __init plat_irq_setup_pins(int mode)
 	}
 }
 
-void __init plat_mem_setup(void)
-{
-}
-
 static int __init sh7786_devices_setup(void)
 {
 	int ret, irq;
diff --git a/arch/sh/kernel/cpu/sh4a/setup-shx3.c b/arch/sh/kernel/cpu/sh4a/setup-shx3.c
index 7014d6d199b3..3197ec2a65cd 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-shx3.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-shx3.c
@@ -377,20 +377,3 @@ void __init plat_irq_setup(void)
 {
 	register_intc_controller(&intc_desc);
 }
-
-void __init plat_mem_setup(void)
-{
-	unsigned int nid = 1;
-
-	/* Register CPU#0 URAM space as Node 1 */
-	setup_bootmem_node(nid++, 0x145f0000, 0x14610000);	/* CPU0 */
-
-#if 0
-	/* XXX: Not yet.. */
-	setup_bootmem_node(nid++, 0x14df0000, 0x14e10000);	/* CPU1 */
-	setup_bootmem_node(nid++, 0x155f0000, 0x15610000);	/* CPU2 */
-	setup_bootmem_node(nid++, 0x15df0000, 0x15e10000);	/* CPU3 */
-#endif
-
-	setup_bootmem_node(nid++, 0x16000000, 0x16020000);	/* CSM */
-}
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c
index fb728906a83f..1efc3104a9df 100644
--- a/arch/sh/mm/init.c
+++ b/arch/sh/mm/init.c
@@ -38,11 +38,6 @@ void __init generic_mem_init(void)
 	memblock_add(__MEMORY_START, __MEMORY_SIZE);
 }
 
-void __init __weak plat_mem_setup(void)
-{
-	/* Nothing to see here, move along. */
-}
-
 #ifdef CONFIG_MMU
 static pte_t *__get_pte_phys(unsigned long addr)
 {
@@ -209,8 +204,6 @@ static void __init do_init_bootmem(void)
 		__add_active_range(0, start_pfn, end_pfn);
 
 	node_set_online(0);
-
-	plat_mem_setup();
 }
 
 static void __init early_reserve_mem(void)

-- 
2.53.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v3 05/10] sh: drop dead code guarded by #ifdef CONFIG_NUMA
  2026-07-02  9:37 [PATCH v3 00/10] sh: remove NUMA and SPARSEMEM support Mike Rapoport (Microsoft)
                   ` (3 preceding siblings ...)
  2026-07-02  9:37 ` [PATCH v3 04/10] sh: remove setup_bootmem_node() and plat_mem_setup() Mike Rapoport (Microsoft)
@ 2026-07-02  9:37 ` Mike Rapoport (Microsoft)
  2026-07-02  9:37 ` [PATCH v3 06/10] sh: drop include/asm/mmzone.h Mike Rapoport (Microsoft)
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: Mike Rapoport (Microsoft) @ 2026-07-02  9:37 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Arnd Bergmann, John Paul Adrian Glaubitz, Mike Rapoport,
	Rich Felker, Yoshinori Sato, linux-sh, linux-kernel, linux-mm

and NUMA-related comments.

Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
---
 arch/sh/include/asm/topology.h | 13 -------------
 arch/sh/kernel/setup.c         |  1 -
 arch/sh/kernel/topology.c      | 12 ------------
 arch/sh/kernel/vmcore_info.c   |  4 ----
 arch/sh/mm/sram.c              |  3 +--
 5 files changed, 1 insertion(+), 32 deletions(-)

diff --git a/arch/sh/include/asm/topology.h b/arch/sh/include/asm/topology.h
index 1db470e02456..a3c31754ba5f 100644
--- a/arch/sh/include/asm/topology.h
+++ b/arch/sh/include/asm/topology.h
@@ -2,19 +2,6 @@
 #ifndef _ASM_SH_TOPOLOGY_H
 #define _ASM_SH_TOPOLOGY_H
 
-#ifdef CONFIG_NUMA
-
-#define cpu_to_node(cpu)	((void)(cpu),0)
-
-#define cpumask_of_node(node)	((void)node, cpu_online_mask)
-
-#define pcibus_to_node(bus)	((void)(bus), -1)
-#define cpumask_of_pcibus(bus)	(pcibus_to_node(bus) == -1 ? \
-					cpu_all_mask : \
-					cpumask_of_node(pcibus_to_node(bus)))
-
-#endif
-
 #define mc_capable()    (1)
 
 const struct cpumask *cpu_coregroup_mask(int cpu);
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
index 039a51291002..5e25c1db4d61 100644
--- a/arch/sh/kernel/setup.c
+++ b/arch/sh/kernel/setup.c
@@ -227,7 +227,6 @@ void __init __add_active_range(unsigned int nid, unsigned long start_pfn,
 	/*
 	 * Also make sure that there is a PMB mapping that covers this
 	 * range before we attempt to activate it, to avoid reset by MMU.
-	 * We can hit this path with NUMA or memory hot-add.
 	 */
 	pmb_bolt_mapping((unsigned long)__va(start), start, end - start,
 			 PAGE_KERNEL);
diff --git a/arch/sh/kernel/topology.c b/arch/sh/kernel/topology.c
index 2d2a7509b565..906b7b1d5443 100644
--- a/arch/sh/kernel/topology.c
+++ b/arch/sh/kernel/topology.c
@@ -57,18 +57,6 @@ static int __init topology_init(void)
 			       __func__, i, ret);
 	}
 
-#if defined(CONFIG_NUMA) && !defined(CONFIG_SMP)
-	/*
-	 * In the UP case, make sure the CPU association is still
-	 * registered under each node. Without this, sysfs fails
-	 * to make the connection between nodes other than node0
-	 * and cpu0.
-	 */
-	for_each_online_node(i)
-		if (i != numa_node_id())
-			register_cpu_under_node(raw_smp_processor_id(), i);
-#endif
-
 	return 0;
 }
 subsys_initcall(topology_init);
diff --git a/arch/sh/kernel/vmcore_info.c b/arch/sh/kernel/vmcore_info.c
index a244a204a1b1..9f029b4a7e63 100644
--- a/arch/sh/kernel/vmcore_info.c
+++ b/arch/sh/kernel/vmcore_info.c
@@ -5,10 +5,6 @@
 
 void arch_crash_save_vmcoreinfo(void)
 {
-#ifdef CONFIG_NUMA
-	VMCOREINFO_SYMBOL(node_data);
-	VMCOREINFO_LENGTH(node_data, MAX_NUMNODES);
-#endif
 #ifdef CONFIG_X2TLB
 	VMCOREINFO_CONFIG(X2TLB);
 #endif
diff --git a/arch/sh/mm/sram.c b/arch/sh/mm/sram.c
index 2d8fa718d55e..208080f072df 100644
--- a/arch/sh/mm/sram.c
+++ b/arch/sh/mm/sram.c
@@ -16,8 +16,7 @@
  * This provides a standard SRAM pool for tiny memories that can be
  * added either by the CPU or the platform code. Typical SRAM sizes
  * to be inserted in to the pool will generally be less than the page
- * size, with anything more reasonably sized handled as a NUMA memory
- * node.
+ * size.
  */
 struct gen_pool *sram_pool;
 

-- 
2.53.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v3 06/10] sh: drop include/asm/mmzone.h
  2026-07-02  9:37 [PATCH v3 00/10] sh: remove NUMA and SPARSEMEM support Mike Rapoport (Microsoft)
                   ` (4 preceding siblings ...)
  2026-07-02  9:37 ` [PATCH v3 05/10] sh: drop dead code guarded by #ifdef CONFIG_NUMA Mike Rapoport (Microsoft)
@ 2026-07-02  9:37 ` Mike Rapoport (Microsoft)
  2026-07-02  9:37 ` [PATCH v3 07/10] init/Kconfig: drop ARCH_WANT_NUMA_VARIABLE_LOCALITY Mike Rapoport (Microsoft)
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: Mike Rapoport (Microsoft) @ 2026-07-02  9:37 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Arnd Bergmann, John Paul Adrian Glaubitz, Mike Rapoport,
	Rich Felker, Yoshinori Sato, linux-sh, linux-kernel, linux-mm

include/asm/mmzone.h was required for declarations of NUMA related
functionality.

The only function declared there that's not related to NUMA is
__add_active_range().

Move __add_active_range() declaration to include/asm/setup.h and drop
include/asm/mmzone.h

Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
---
 arch/sh/include/asm/mmzone.h           | 42 ----------------------------------
 arch/sh/include/asm/setup.h            |  3 +++
 arch/sh/kernel/cpu/sh4a/setup-sh7722.c |  1 -
 arch/sh/kernel/cpu/sh4a/setup-sh7723.c |  1 -
 arch/sh/kernel/cpu/sh4a/setup-sh7724.c |  1 -
 arch/sh/kernel/cpu/sh4a/setup-sh7757.c |  1 -
 arch/sh/kernel/cpu/sh4a/setup-sh7785.c |  1 -
 arch/sh/kernel/cpu/sh4a/setup-sh7786.c |  1 -
 arch/sh/kernel/cpu/sh4a/setup-shx3.c   |  1 -
 arch/sh/kernel/setup.c                 |  2 --
 arch/sh/mm/init.c                      |  1 -
 11 files changed, 3 insertions(+), 52 deletions(-)

diff --git a/arch/sh/include/asm/mmzone.h b/arch/sh/include/asm/mmzone.h
deleted file mode 100644
index 63f88b465e39..000000000000
--- a/arch/sh/include/asm/mmzone.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef __ASM_SH_MMZONE_H
-#define __ASM_SH_MMZONE_H
-
-#ifdef CONFIG_NUMA
-#include <linux/numa.h>
-
-static inline int pfn_to_nid(unsigned long pfn)
-{
-	int nid;
-
-	for (nid = 0; nid < MAX_NUMNODES; nid++)
-		if (pfn >= node_start_pfn(nid) && pfn <= node_end_pfn(nid))
-			break;
-
-	return nid;
-}
-
-static inline struct pglist_data *pfn_to_pgdat(unsigned long pfn)
-{
-	return NODE_DATA(pfn_to_nid(pfn));
-}
-
-/* arch/sh/mm/numa.c */
-void __init setup_bootmem_node(int nid, unsigned long start, unsigned long end);
-#else
-static inline void
-setup_bootmem_node(int nid, unsigned long start, unsigned long end)
-{
-}
-#endif /* CONFIG_NUMA */
-
-/* Platform specific mem init */
-void __init plat_mem_setup(void);
-
-/* arch/sh/kernel/setup.c */
-void __init __add_active_range(unsigned int nid, unsigned long start_pfn,
-			       unsigned long end_pfn);
-/* arch/sh/mm/init.c */
-void __init allocate_pgdat(unsigned int nid);
-
-#endif /* __ASM_SH_MMZONE_H */
diff --git a/arch/sh/include/asm/setup.h b/arch/sh/include/asm/setup.h
index 8488f76b48b4..6762612f456c 100644
--- a/arch/sh/include/asm/setup.h
+++ b/arch/sh/include/asm/setup.h
@@ -24,4 +24,7 @@ void check_for_initrd(void);
 void per_cpu_trap_init(void);
 void sh_fdt_init(phys_addr_t dt_phys);
 
+void __add_active_range(unsigned int nid, unsigned long start_pfn,
+			unsigned long end_pfn);
+
 #endif /* _SH_SETUP_H */
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
index 2180819a1455..5e2c24c518b4 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
@@ -16,7 +16,6 @@
 #include <linux/usb/m66592.h>
 
 #include <asm/clock.h>
-#include <asm/mmzone.h>
 #include <asm/siu.h>
 #include <asm/platform_early.h>
 
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7723.c b/arch/sh/kernel/cpu/sh4a/setup-sh7723.c
index d64d28c4f059..5c24ff407c89 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7723.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7723.c
@@ -17,7 +17,6 @@
 
 #include <asm/cacheflush.h>
 #include <asm/clock.h>
-#include <asm/mmzone.h>
 #include <asm/platform_early.h>
 
 #include <cpu/sh7723.h>
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
index ef4b26a4b3d6..9441e4a0f402 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
@@ -24,7 +24,6 @@
 #include <asm/cacheflush.h>
 #include <asm/suspend.h>
 #include <asm/clock.h>
-#include <asm/mmzone.h>
 #include <asm/platform_early.h>
 
 #include <cpu/dma-register.h>
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
index 1f4396da00e5..3750b598d6bd 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
@@ -21,7 +21,6 @@
 #include <cpu/dma-register.h>
 #include <cpu/sh7757.h>
 
-#include <asm/mmzone.h>
 #include <asm/platform_early.h>
 
 static struct plat_sci_port scif2_platform_data = {
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7785.c b/arch/sh/kernel/cpu/sh4a/setup-sh7785.c
index 95c3cc15a443..13f08c44fb02 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7785.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7785.c
@@ -13,7 +13,6 @@
 #include <linux/sh_dma.h>
 #include <linux/sh_timer.h>
 #include <linux/sh_intc.h>
-#include <asm/mmzone.h>
 #include <asm/platform_early.h>
 #include <cpu/dma-register.h>
 
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
index a46d6c3241a9..79484c598b83 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
@@ -22,7 +22,6 @@
 #include <linux/sh_intc.h>
 #include <linux/usb/ohci_pdriver.h>
 #include <cpu/dma-register.h>
-#include <asm/mmzone.h>
 #include <asm/platform_early.h>
 
 static struct plat_sci_port scif0_platform_data = {
diff --git a/arch/sh/kernel/cpu/sh4a/setup-shx3.c b/arch/sh/kernel/cpu/sh4a/setup-shx3.c
index 3197ec2a65cd..93cdd1ee888d 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-shx3.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-shx3.c
@@ -13,7 +13,6 @@
 #include <linux/sh_timer.h>
 #include <linux/sh_intc.h>
 #include <cpu/shx3.h>
-#include <asm/mmzone.h>
 #include <asm/platform_early.h>
 
 /*
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
index 5e25c1db4d61..2f2764061003 100644
--- a/arch/sh/kernel/setup.c
+++ b/arch/sh/kernel/setup.c
@@ -23,7 +23,6 @@
 #include <linux/smp.h>
 #include <linux/err.h>
 #include <linux/crash_dump.h>
-#include <linux/mmzone.h>
 #include <linux/clk.h>
 #include <linux/delay.h>
 #include <linux/platform_device.h>
@@ -41,7 +40,6 @@
 #include <asm/clock.h>
 #include <asm/smp.h>
 #include <asm/mmu_context.h>
-#include <asm/mmzone.h>
 #include <asm/processor.h>
 #include <asm/sparsemem.h>
 #include <asm/platform_early.h>
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c
index 1efc3104a9df..b337e6a259ed 100644
--- a/arch/sh/mm/init.c
+++ b/arch/sh/mm/init.c
@@ -20,7 +20,6 @@
 #include <linux/dma-mapping.h>
 #include <linux/export.h>
 #include <asm/mmu_context.h>
-#include <asm/mmzone.h>
 #include <asm/kexec.h>
 #include <asm/tlb.h>
 #include <asm/cacheflush.h>

-- 
2.53.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v3 07/10] init/Kconfig: drop ARCH_WANT_NUMA_VARIABLE_LOCALITY
  2026-07-02  9:37 [PATCH v3 00/10] sh: remove NUMA and SPARSEMEM support Mike Rapoport (Microsoft)
                   ` (5 preceding siblings ...)
  2026-07-02  9:37 ` [PATCH v3 06/10] sh: drop include/asm/mmzone.h Mike Rapoport (Microsoft)
@ 2026-07-02  9:37 ` Mike Rapoport (Microsoft)
  2026-07-02  9:37 ` [PATCH v3 08/10] sh: init: remove call the memblock_set_node() Mike Rapoport (Microsoft)
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: Mike Rapoport (Microsoft) @ 2026-07-02  9:37 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Arnd Bergmann, John Paul Adrian Glaubitz, Mike Rapoport,
	Rich Felker, Yoshinori Sato, linux-sh, linux-kernel, linux-mm

sh was the only architecture that selected ARCH_WANT_NUMA_VARIABLE_LOCALITY.

With NUMA support on sh gone, there is no need in this configuration
option.

Remove it.

Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
---
 init/Kconfig | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/init/Kconfig b/init/Kconfig
index 5230d4879b1c..e8ea2d7697bf 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1001,16 +1001,9 @@ config CC_STRINGOP_OVERFLOW
 config ARCH_SUPPORTS_INT128
 	bool
 
-# For architectures that (ab)use NUMA to represent different memory regions
-# all cpu-local but of different latencies, such as SuperH.
-#
-config ARCH_WANT_NUMA_VARIABLE_LOCALITY
-	bool
-
 config NUMA_BALANCING
 	bool "Memory placement aware NUMA scheduler"
 	depends on ARCH_SUPPORTS_NUMA_BALANCING
-	depends on !ARCH_WANT_NUMA_VARIABLE_LOCALITY
 	depends on SMP && NUMA_MIGRATION && !PREEMPT_RT
 	help
 	  This option adds support for automatic NUMA aware memory/task placement.

-- 
2.53.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v3 08/10] sh: init: remove call the memblock_set_node()
  2026-07-02  9:37 [PATCH v3 00/10] sh: remove NUMA and SPARSEMEM support Mike Rapoport (Microsoft)
                   ` (6 preceding siblings ...)
  2026-07-02  9:37 ` [PATCH v3 07/10] init/Kconfig: drop ARCH_WANT_NUMA_VARIABLE_LOCALITY Mike Rapoport (Microsoft)
@ 2026-07-02  9:37 ` Mike Rapoport (Microsoft)
  2026-07-02  9:37 ` [PATCH v3 09/10] sh: remove SPARSEMEM related entries from Kconfig Mike Rapoport (Microsoft)
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: Mike Rapoport (Microsoft) @ 2026-07-02  9:37 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Arnd Bergmann, John Paul Adrian Glaubitz, Mike Rapoport,
	Rich Felker, Yoshinori Sato, linux-sh, linux-kernel, linux-mm

Without CONFIG_NUMA, the call to memblock_set_node() is not needed.

Remove it.

Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
---
 arch/sh/kernel/setup.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
index 2f2764061003..43d0f7b62b03 100644
--- a/arch/sh/kernel/setup.c
+++ b/arch/sh/kernel/setup.c
@@ -228,9 +228,6 @@ void __init __add_active_range(unsigned int nid, unsigned long start_pfn,
 	 */
 	pmb_bolt_mapping((unsigned long)__va(start), start, end - start,
 			 PAGE_KERNEL);
-
-	memblock_set_node(PFN_PHYS(start_pfn), PFN_PHYS(end_pfn - start_pfn),
-			  &memblock.memory, nid);
 }
 
 void __init __weak plat_early_device_setup(void)

-- 
2.53.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v3 09/10] sh: remove SPARSEMEM related entries from Kconfig
  2026-07-02  9:37 [PATCH v3 00/10] sh: remove NUMA and SPARSEMEM support Mike Rapoport (Microsoft)
                   ` (7 preceding siblings ...)
  2026-07-02  9:37 ` [PATCH v3 08/10] sh: init: remove call the memblock_set_node() Mike Rapoport (Microsoft)
@ 2026-07-02  9:37 ` Mike Rapoport (Microsoft)
  2026-07-02  9:37 ` [PATCH v3 10/10] sh: drop include/asm/sparsemem.h Mike Rapoport (Microsoft)
  2026-07-02  9:54 ` [PATCH v3 00/10] sh: remove NUMA and SPARSEMEM support John Paul Adrian Glaubitz
  10 siblings, 0 replies; 15+ messages in thread
From: Mike Rapoport (Microsoft) @ 2026-07-02  9:37 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Arnd Bergmann, John Paul Adrian Glaubitz, Mike Rapoport,
	Rich Felker, Yoshinori Sato, linux-sh, linux-kernel, linux-mm

Without NUMA support, SPARSEMEM related configuration options only create
unnecessary overhead.

Remove them.

Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
---
 arch/sh/Kconfig    |  6 ------
 arch/sh/mm/Kconfig | 10 ----------
 2 files changed, 16 deletions(-)

diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index d0ba91eba71a..ec50072a6f22 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -386,7 +386,6 @@ config CPU_SUBTYPE_SH7723
 	select CPU_SH4A
 	select CPU_SHX2
 	select ARCH_SHMOBILE
-	select ARCH_SPARSEMEM_ENABLE
 	select SYS_SUPPORTS_SH_CMT
 	select PINCTRL
 	help
@@ -397,7 +396,6 @@ config CPU_SUBTYPE_SH7724
 	select CPU_SH4A
 	select CPU_SHX2
 	select ARCH_SHMOBILE
-	select ARCH_SPARSEMEM_ENABLE
 	select SYS_SUPPORTS_SH_CMT
 	select PINCTRL
 	help
@@ -438,7 +436,6 @@ config CPU_SUBTYPE_SH7785
 	bool "Support SH7785 processor"
 	select CPU_SH4A
 	select CPU_SHX2
-	select ARCH_SPARSEMEM_ENABLE
 	select PINCTRL
 
 config CPU_SUBTYPE_SH7786
@@ -472,7 +469,6 @@ config CPU_SUBTYPE_SH7722
 	select CPU_SH4AL_DSP
 	select CPU_SHX2
 	select ARCH_SHMOBILE
-	select ARCH_SPARSEMEM_ENABLE
 	select SYS_SUPPORTS_SH_CMT
 	select PINCTRL
 
@@ -481,8 +477,6 @@ config CPU_SUBTYPE_SH7366
 	select CPU_SH4AL_DSP
 	select CPU_SHX2
 	select ARCH_SHMOBILE
-	select ARCH_SPARSEMEM_ENABLE
-	select SYS_SUPPORTS_NUMA
 	select SYS_SUPPORTS_SH_CMT
 
 endchoice
diff --git a/arch/sh/mm/Kconfig b/arch/sh/mm/Kconfig
index 71fecbbb080e..c7d889a1a9d7 100644
--- a/arch/sh/mm/Kconfig
+++ b/arch/sh/mm/Kconfig
@@ -115,16 +115,6 @@ config VSYSCALL
 config ARCH_FLATMEM_ENABLE
 	def_bool y
 
-config ARCH_SPARSEMEM_ENABLE
-	def_bool y
-	select SPARSEMEM_STATIC
-
-config ARCH_SPARSEMEM_DEFAULT
-	def_bool y
-
-config ARCH_SELECT_MEMORY_MODEL
-	def_bool y
-
 config IOREMAP_FIXED
        def_bool y
        depends on X2TLB

-- 
2.53.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v3 10/10] sh: drop include/asm/sparsemem.h
  2026-07-02  9:37 [PATCH v3 00/10] sh: remove NUMA and SPARSEMEM support Mike Rapoport (Microsoft)
                   ` (8 preceding siblings ...)
  2026-07-02  9:37 ` [PATCH v3 09/10] sh: remove SPARSEMEM related entries from Kconfig Mike Rapoport (Microsoft)
@ 2026-07-02  9:37 ` Mike Rapoport (Microsoft)
  2026-07-02  9:54 ` [PATCH v3 00/10] sh: remove NUMA and SPARSEMEM support John Paul Adrian Glaubitz
  10 siblings, 0 replies; 15+ messages in thread
From: Mike Rapoport (Microsoft) @ 2026-07-02  9:37 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Arnd Bergmann, John Paul Adrian Glaubitz, Mike Rapoport,
	Rich Felker, Yoshinori Sato, linux-sh, linux-kernel, linux-mm

Move MAX_PHYSMEM_BITS declaration to include/asm/mmu.h and drop now
unneeded include/asm/sparsemem.h

Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
---
 arch/sh/include/asm/mmu.h       |  2 ++
 arch/sh/include/asm/sparsemem.h | 12 ------------
 arch/sh/kernel/setup.c          |  1 -
 3 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/arch/sh/include/asm/mmu.h b/arch/sh/include/asm/mmu.h
index b9c9f91e6616..def7c1edd605 100644
--- a/arch/sh/include/asm/mmu.h
+++ b/arch/sh/include/asm/mmu.h
@@ -2,6 +2,8 @@
 #ifndef __MMU_H
 #define __MMU_H
 
+#define MAX_PHYSMEM_BITS	32
+
 /*
  * Privileged Space Mapping Buffer (PMB) definitions
  */
diff --git a/arch/sh/include/asm/sparsemem.h b/arch/sh/include/asm/sparsemem.h
deleted file mode 100644
index 4703cbe23844..000000000000
--- a/arch/sh/include/asm/sparsemem.h
+++ /dev/null
@@ -1,12 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef __ASM_SH_SPARSEMEM_H
-#define __ASM_SH_SPARSEMEM_H
-
-/*
- * SECTION_SIZE_BITS		2^N: how big each section will be
- * MAX_PHYSMEM_BITS		2^N: how much physical address space we have
- */
-#define SECTION_SIZE_BITS	26
-#define MAX_PHYSMEM_BITS	32
-
-#endif /* __ASM_SH_SPARSEMEM_H */
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
index 43d0f7b62b03..99f52d888aa3 100644
--- a/arch/sh/kernel/setup.c
+++ b/arch/sh/kernel/setup.c
@@ -41,7 +41,6 @@
 #include <asm/smp.h>
 #include <asm/mmu_context.h>
 #include <asm/processor.h>
-#include <asm/sparsemem.h>
 #include <asm/platform_early.h>
 
 /*

-- 
2.53.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH v3 00/10] sh: remove NUMA and SPARSEMEM support
  2026-07-02  9:37 [PATCH v3 00/10] sh: remove NUMA and SPARSEMEM support Mike Rapoport (Microsoft)
                   ` (9 preceding siblings ...)
  2026-07-02  9:37 ` [PATCH v3 10/10] sh: drop include/asm/sparsemem.h Mike Rapoport (Microsoft)
@ 2026-07-02  9:54 ` John Paul Adrian Glaubitz
  2026-07-02 10:20   ` Mike Rapoport
  10 siblings, 1 reply; 15+ messages in thread
From: John Paul Adrian Glaubitz @ 2026-07-02  9:54 UTC (permalink / raw)
  To: Mike Rapoport (Microsoft), Andrew Morton
  Cc: Arnd Bergmann, Rich Felker, Yoshinori Sato, linux-sh,
	linux-kernel, linux-mm

Hi,

On Thu, 2026-07-02 at 12:37 +0300, Mike Rapoport (Microsoft) wrote:
> Hi,
> 
> NUMA support for SuperH was introduced a long time ago by commit
> b241cb0c885e ("sh: Support for multiple nodes.")
> 
>         "... for boards with many different memory blocks that are
>          otherwise unused (SH7722/SH7785 URAM and so forth)"
> 
> In reality, this added 128K of memory on sh7722 and sh7785 and 256K on
> shx3 at the expense of all the NUMA related code in the kernel.
> 
> For build of v7.0-rc7 with defconfig and the same configuration with
> CONFIG_NUMA disabled, bloat-o-meter reports difference of ~76k. Disabling
> CONFIG_SPARSMEM on top increases the difference to ~94k. And that's only
> overhead in code and static data that does not take into the account data
> structures allocated at run time.
> 
> And all this overhead has been there for nothing for almost 8 years
> because since commit ac21fc2dcb40 ("sh: switch to NO_BOOTMEM")
> those additional "nodes" could not be used by the core MM because the
> maximal pfn for ZONE_NORMAL was cut out at the end of the normal memory.
> 
> ---
> It's been another few weeks without updates from Adrian and I don't see
> why it should wait more.
> 
> @Andrew, please take it to the mm tree.

I feel like this is an attempt to force me to give up as a maintainer.

Otherwise, I can't really understand why you are building up so much
pressure for a niche and hobbyist architecture

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v3 00/10] sh: remove NUMA and SPARSEMEM support
  2026-07-02  9:54 ` [PATCH v3 00/10] sh: remove NUMA and SPARSEMEM support John Paul Adrian Glaubitz
@ 2026-07-02 10:20   ` Mike Rapoport
  2026-07-02 10:25     ` John Paul Adrian Glaubitz
  0 siblings, 1 reply; 15+ messages in thread
From: Mike Rapoport @ 2026-07-02 10:20 UTC (permalink / raw)
  To: John Paul Adrian Glaubitz
  Cc: Andrew Morton, Arnd Bergmann, Rich Felker, Yoshinori Sato,
	linux-sh, linux-kernel, linux-mm

Hi Adrian,

On Thu, Jul 02, 2026 at 11:54:59AM +0200, John Paul Adrian Glaubitz wrote:
> Hi,
> 
> On Thu, 2026-07-02 at 12:37 +0300, Mike Rapoport (Microsoft) wrote:
> > Hi,
> > 
> > NUMA support for SuperH was introduced a long time ago by commit
> > b241cb0c885e ("sh: Support for multiple nodes.")
> > 
> >         "... for boards with many different memory blocks that are
> >          otherwise unused (SH7722/SH7785 URAM and so forth)"
> > 
> > In reality, this added 128K of memory on sh7722 and sh7785 and 256K on
> > shx3 at the expense of all the NUMA related code in the kernel.
> > 
> > For build of v7.0-rc7 with defconfig and the same configuration with
> > CONFIG_NUMA disabled, bloat-o-meter reports difference of ~76k. Disabling
> > CONFIG_SPARSMEM on top increases the difference to ~94k. And that's only
> > overhead in code and static data that does not take into the account data
> > structures allocated at run time.
> > 
> > And all this overhead has been there for nothing for almost 8 years
> > because since commit ac21fc2dcb40 ("sh: switch to NO_BOOTMEM")
> > those additional "nodes" could not be used by the core MM because the
> > maximal pfn for ZONE_NORMAL was cut out at the end of the normal memory.
> > 
> > ---
> > It's been another few weeks without updates from Adrian and I don't see
> > why it should wait more.
> > 
> > @Andrew, please take it to the mm tree.
> 
> I feel like this is an attempt to force me to give up as a maintainer.

This isn't an attempt to force you to give up, this is an attempt to merge
patches that have been out there for long time.

They are related to mm because we are talking about mm features. And it is
long standing practice that Andrew takes patches that fall between the
cracks.

v1 went out in the middle of April, there were no comments at all from you
almost for a month and I sent v2 on May 10th.

We are in July now, so this is definitely falling between the cracks.
 
> Otherwise, I can't really understand why you are building up so much
> pressure for a niche and hobbyist architecture

By pressure you mean an email in a few weeks?!

This isn't about sh, this is about reducing NUMA and SPARSEMEM_STATIC
footprint to ease the maintenance.

A niche and hobbyist architecture does not need NUMA and SPARSEMEM.
And for sh particularly they should have not be enabled at the first place.
 
> Adrian

-- 
Sincerely yours,
Mike.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v3 00/10] sh: remove NUMA and SPARSEMEM support
  2026-07-02 10:20   ` Mike Rapoport
@ 2026-07-02 10:25     ` John Paul Adrian Glaubitz
  2026-07-03  6:16       ` Mike Rapoport
  0 siblings, 1 reply; 15+ messages in thread
From: John Paul Adrian Glaubitz @ 2026-07-02 10:25 UTC (permalink / raw)
  To: Mike Rapoport
  Cc: Andrew Morton, Arnd Bergmann, Rich Felker, Yoshinori Sato,
	linux-sh, linux-kernel, linux-mm

Hello Mike,

On Thu, 2026-07-02 at 13:20 +0300, Mike Rapoport wrote:
> > I feel like this is an attempt to force me to give up as a maintainer.
> 
> This isn't an attempt to force you to give up, this is an attempt to merge
> patches that have been out there for long time.

You posted these patches the first time in April. This isn't a long time.

There were patches that have been on the mailing list for years without
being merged.

Arnd has, for example, sent out patches to make to allow the kernel being
built with different alignment so that we can switch Debian's m68k port
to 32-bit without breaking anything. I have been waiting for these for a
long time now and these also haven't been merged. It just happens sometimes.

> They are related to mm because we are talking about mm features. And it is
> long standing practice that Andrew takes patches that fall between the
> cracks.

It's not falling through the cracks. I have always picked up almost every
patch that people sent. It just sometimes takes me a little longer because
I'm not a professional maintainer, I also have a dayjob to attend and I also
sometimes have a private life to deal with.

> v1 went out in the middle of April, there were no comments at all from you
> almost for a month and I sent v2 on May 10th.
> 
> We are in July now, so this is definitely falling between the cracks.

No, it's not.

> > Otherwise, I can't really understand why you are building up so much
> > pressure for a niche and hobbyist architecture
> 
> By pressure you mean an email in a few weeks?!

By pressure I mean insisting on getting it merged and now trying to work
around me completely ignoring me despite me being the maintainer.

Yes, that's pressure.

> This isn't about sh, this is about reducing NUMA and SPARSEMEM_STATIC
> footprint to ease the maintenance.
> 
> A niche and hobbyist architecture does not need NUMA and SPARSEMEM.
> And for sh particularly they should have not be enabled at the first place.

Yes, and I will eventually pick up those patches to rectify this.

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v3 00/10] sh: remove NUMA and SPARSEMEM support
  2026-07-02 10:25     ` John Paul Adrian Glaubitz
@ 2026-07-03  6:16       ` Mike Rapoport
  0 siblings, 0 replies; 15+ messages in thread
From: Mike Rapoport @ 2026-07-03  6:16 UTC (permalink / raw)
  To: John Paul Adrian Glaubitz
  Cc: Andrew Morton, Arnd Bergmann, Rich Felker, Yoshinori Sato,
	linux-sh, linux-kernel, linux-mm

Hi Adrian,

On Thu, Jul 02, 2026 at 12:25:47PM +0200, John Paul Adrian Glaubitz wrote:
> Hello Mike,
> 
> On Thu, 2026-07-02 at 13:20 +0300, Mike Rapoport wrote:
> > > I feel like this is an attempt to force me to give up as a maintainer.
> > 
> > This isn't an attempt to force you to give up, this is an attempt to merge
> > patches that have been out there for long time.
> 
> You posted these patches the first time in April. This isn't a long time.

It is by mm standards.
 
> > This isn't about sh, this is about reducing NUMA and SPARSEMEM_STATIC
> > footprint to ease the maintenance.
> 
> Yes, and I will eventually pick up those patches to rectify this.

Why do you insist that these patches must go via sh-linux tree?

If you don't have time right now because of other commitments, Andrew is
here to help in exactly these cases: let patches move upstream when a
subsystem maintainer is too overloaded.
 
> Adrian

-- 
Sincerely yours,
Mike.

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2026-07-03  6:16 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-02  9:37 [PATCH v3 00/10] sh: remove NUMA and SPARSEMEM support Mike Rapoport (Microsoft)
2026-07-02  9:37 ` [PATCH v3 01/10] sh: remove CONFIG_NUMA and realted configuration options Mike Rapoport (Microsoft)
2026-07-02  9:37 ` [PATCH v3 02/10] sh: mm: remove numa.c Mike Rapoport (Microsoft)
2026-07-02  9:37 ` [PATCH v3 03/10] sh: mm: drop allocate_pgdat() Mike Rapoport (Microsoft)
2026-07-02  9:37 ` [PATCH v3 04/10] sh: remove setup_bootmem_node() and plat_mem_setup() Mike Rapoport (Microsoft)
2026-07-02  9:37 ` [PATCH v3 05/10] sh: drop dead code guarded by #ifdef CONFIG_NUMA Mike Rapoport (Microsoft)
2026-07-02  9:37 ` [PATCH v3 06/10] sh: drop include/asm/mmzone.h Mike Rapoport (Microsoft)
2026-07-02  9:37 ` [PATCH v3 07/10] init/Kconfig: drop ARCH_WANT_NUMA_VARIABLE_LOCALITY Mike Rapoport (Microsoft)
2026-07-02  9:37 ` [PATCH v3 08/10] sh: init: remove call the memblock_set_node() Mike Rapoport (Microsoft)
2026-07-02  9:37 ` [PATCH v3 09/10] sh: remove SPARSEMEM related entries from Kconfig Mike Rapoport (Microsoft)
2026-07-02  9:37 ` [PATCH v3 10/10] sh: drop include/asm/sparsemem.h Mike Rapoport (Microsoft)
2026-07-02  9:54 ` [PATCH v3 00/10] sh: remove NUMA and SPARSEMEM support John Paul Adrian Glaubitz
2026-07-02 10:20   ` Mike Rapoport
2026-07-02 10:25     ` John Paul Adrian Glaubitz
2026-07-03  6:16       ` Mike Rapoport

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox