* [PATCH 01/10] sh: remove CONFIG_NUMA and realted configuration options
2026-04-13 10:46 [PATCH 00/10] sh: remove NUMA and SPARSEMEM support Mike Rapoport
@ 2026-04-13 10:46 ` Mike Rapoport
2026-04-13 10:46 ` [PATCH 02/10] sh: mm: remove numa.c Mike Rapoport
` (10 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: Mike Rapoport @ 2026-04-13 10:46 UTC (permalink / raw)
To: linux-sh
Cc: Andrew Morton, Arnd Bergmann, John Paul Adrian Glaubitz,
Mike Rapoport, Rich Felker, Yoshinori Sato, linux-kernel,
linux-mm
From: "Mike Rapoport (Microsoft)" <rppt@kernel.org>
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.
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
---
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 -------------------
6 files changed, 24 deletions(-)
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 0d1c858754db..ff15d68dd12d 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 [flat|nested] 14+ messages in thread* [PATCH 02/10] sh: mm: remove numa.c
2026-04-13 10:46 [PATCH 00/10] sh: remove NUMA and SPARSEMEM support Mike Rapoport
2026-04-13 10:46 ` [PATCH 01/10] sh: remove CONFIG_NUMA and realted configuration options Mike Rapoport
@ 2026-04-13 10:46 ` Mike Rapoport
2026-04-13 10:46 ` [PATCH 03/10] sh: mm: drop allocate_pgdat() Mike Rapoport
` (9 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: Mike Rapoport @ 2026-04-13 10:46 UTC (permalink / raw)
To: linux-sh
Cc: Andrew Morton, Arnd Bergmann, John Paul Adrian Glaubitz,
Mike Rapoport, Rich Felker, Yoshinori Sato, linux-kernel,
linux-mm
From: "Mike Rapoport (Microsoft)" <rppt@kernel.org>
Since CONFIG_NUMA is removed, numa.c won't be ever compiled.
Remove it.
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(-)
delete mode 100644 arch/sh/mm/numa.c
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 [flat|nested] 14+ messages in thread* [PATCH 03/10] sh: mm: drop allocate_pgdat()
2026-04-13 10:46 [PATCH 00/10] sh: remove NUMA and SPARSEMEM support Mike Rapoport
2026-04-13 10:46 ` [PATCH 01/10] sh: remove CONFIG_NUMA and realted configuration options Mike Rapoport
2026-04-13 10:46 ` [PATCH 02/10] sh: mm: remove numa.c Mike Rapoport
@ 2026-04-13 10:46 ` Mike Rapoport
2026-04-13 10:46 ` [PATCH 04/10] sh: remove setup_bootmem_node() and plat_mem_setup() Mike Rapoport
` (8 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: Mike Rapoport @ 2026-04-13 10:46 UTC (permalink / raw)
To: linux-sh
Cc: Andrew Morton, Arnd Bergmann, John Paul Adrian Glaubitz,
Mike Rapoport, Rich Felker, Yoshinori Sato, linux-kernel,
linux-mm
From: "Mike Rapoport (Microsoft)" <rppt@kernel.org>
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.
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 464a3a63e2fa..977392b478b3 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 [flat|nested] 14+ messages in thread* [PATCH 04/10] sh: remove setup_bootmem_node() and plat_mem_setup()
2026-04-13 10:46 [PATCH 00/10] sh: remove NUMA and SPARSEMEM support Mike Rapoport
` (2 preceding siblings ...)
2026-04-13 10:46 ` [PATCH 03/10] sh: mm: drop allocate_pgdat() Mike Rapoport
@ 2026-04-13 10:46 ` Mike Rapoport
2026-04-13 10:46 ` [PATCH 05/10] sh: drop dead code guarded by #ifdef CONFIG_NUMA Mike Rapoport
` (7 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: Mike Rapoport @ 2026-04-13 10:46 UTC (permalink / raw)
To: linux-sh
Cc: Andrew Morton, Arnd Bergmann, John Paul Adrian Glaubitz,
Mike Rapoport, Rich Felker, Yoshinori Sato, linux-kernel,
linux-mm
From: "Mike Rapoport (Microsoft)" <rppt@kernel.org>
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.
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 977392b478b3..b34ba42d1e18 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 [flat|nested] 14+ messages in thread* [PATCH 05/10] sh: drop dead code guarded by #ifdef CONFIG_NUMA
2026-04-13 10:46 [PATCH 00/10] sh: remove NUMA and SPARSEMEM support Mike Rapoport
` (3 preceding siblings ...)
2026-04-13 10:46 ` [PATCH 04/10] sh: remove setup_bootmem_node() and plat_mem_setup() Mike Rapoport
@ 2026-04-13 10:46 ` Mike Rapoport
2026-04-13 10:46 ` [PATCH 06/10] sh: drop include/asm/mmzone.h Mike Rapoport
` (6 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: Mike Rapoport @ 2026-04-13 10:46 UTC (permalink / raw)
To: linux-sh
Cc: Andrew Morton, Arnd Bergmann, John Paul Adrian Glaubitz,
Mike Rapoport, Rich Felker, Yoshinori Sato, linux-kernel,
linux-mm
From: "Mike Rapoport (Microsoft)" <rppt@kernel.org>
and NUMA-related comments.
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 [flat|nested] 14+ messages in thread* [PATCH 06/10] sh: drop include/asm/mmzone.h
2026-04-13 10:46 [PATCH 00/10] sh: remove NUMA and SPARSEMEM support Mike Rapoport
` (4 preceding siblings ...)
2026-04-13 10:46 ` [PATCH 05/10] sh: drop dead code guarded by #ifdef CONFIG_NUMA Mike Rapoport
@ 2026-04-13 10:46 ` Mike Rapoport
2026-04-13 10:46 ` [PATCH 07/10] init/Kconfig: drop ARCH_WANT_NUMA_VARIABLE_LOCALITY Mike Rapoport
` (5 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: Mike Rapoport @ 2026-04-13 10:46 UTC (permalink / raw)
To: linux-sh
Cc: Andrew Morton, Arnd Bergmann, John Paul Adrian Glaubitz,
Mike Rapoport, Rich Felker, Yoshinori Sato, linux-kernel,
linux-mm
From: "Mike Rapoport (Microsoft)" <rppt@kernel.org>
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
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(-)
delete mode 100644 arch/sh/include/asm/mmzone.h
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 84bb23a771f3..6bd5b0d87abe 100644
--- a/arch/sh/include/asm/setup.h
+++ b/arch/sh/include/asm/setup.h
@@ -23,4 +23,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 b34ba42d1e18..31a9676efbe3 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 [flat|nested] 14+ messages in thread* [PATCH 07/10] init/Kconfig: drop ARCH_WANT_NUMA_VARIABLE_LOCALITY
2026-04-13 10:46 [PATCH 00/10] sh: remove NUMA and SPARSEMEM support Mike Rapoport
` (5 preceding siblings ...)
2026-04-13 10:46 ` [PATCH 06/10] sh: drop include/asm/mmzone.h Mike Rapoport
@ 2026-04-13 10:46 ` Mike Rapoport
2026-04-13 10:46 ` [PATCH 08/10] sh: init: remove call the memblock_set_node() Mike Rapoport
` (4 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: Mike Rapoport @ 2026-04-13 10:46 UTC (permalink / raw)
To: linux-sh
Cc: Andrew Morton, Arnd Bergmann, John Paul Adrian Glaubitz,
Mike Rapoport, Rich Felker, Yoshinori Sato, linux-kernel,
linux-mm
From: "Mike Rapoport (Microsoft)" <rppt@kernel.org>
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.
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 7484cd703bc1..c31fb292729f 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -987,16 +987,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 [flat|nested] 14+ messages in thread* [PATCH 08/10] sh: init: remove call the memblock_set_node()
2026-04-13 10:46 [PATCH 00/10] sh: remove NUMA and SPARSEMEM support Mike Rapoport
` (6 preceding siblings ...)
2026-04-13 10:46 ` [PATCH 07/10] init/Kconfig: drop ARCH_WANT_NUMA_VARIABLE_LOCALITY Mike Rapoport
@ 2026-04-13 10:46 ` Mike Rapoport
2026-04-13 10:46 ` [PATCH 09/10] sh: remove SPARSEMEM related entries from Kconfig Mike Rapoport
` (3 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: Mike Rapoport @ 2026-04-13 10:46 UTC (permalink / raw)
To: linux-sh
Cc: Andrew Morton, Arnd Bergmann, John Paul Adrian Glaubitz,
Mike Rapoport, Rich Felker, Yoshinori Sato, linux-kernel,
linux-mm
From: "Mike Rapoport (Microsoft)" <rppt@kernel.org>
Without CONFIG_NUMA, the call to memblock_set_node() is not needed.
Remove it.
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 [flat|nested] 14+ messages in thread* [PATCH 09/10] sh: remove SPARSEMEM related entries from Kconfig
2026-04-13 10:46 [PATCH 00/10] sh: remove NUMA and SPARSEMEM support Mike Rapoport
` (7 preceding siblings ...)
2026-04-13 10:46 ` [PATCH 08/10] sh: init: remove call the memblock_set_node() Mike Rapoport
@ 2026-04-13 10:46 ` Mike Rapoport
2026-04-13 10:46 ` [PATCH 10/10] sh: drop include/asm/sparsemem.h Mike Rapoport
` (2 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: Mike Rapoport @ 2026-04-13 10:46 UTC (permalink / raw)
To: linux-sh
Cc: Andrew Morton, Arnd Bergmann, John Paul Adrian Glaubitz,
Mike Rapoport, Rich Felker, Yoshinori Sato, linux-kernel,
linux-mm
From: "Mike Rapoport (Microsoft)" <rppt@kernel.org>
Without NUMA support, SPARSEMEM related configuration options only create
unnecessary overhead.
Remove them.
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
---
arch/sh/Kconfig | 8 --------
arch/sh/mm/Kconfig | 10 ----------
2 files changed, 18 deletions(-)
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index d5795067befa..29d55f12ad50 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -390,7 +390,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
@@ -401,7 +400,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
@@ -442,8 +440,6 @@ config CPU_SUBTYPE_SH7785
bool "Support SH7785 processor"
select CPU_SH4A
select CPU_SHX2
- select ARCH_SPARSEMEM_ENABLE
- select SYS_SUPPORTS_NUMA
select PINCTRL
config CPU_SUBTYPE_SH7786
@@ -477,8 +473,6 @@ config CPU_SUBTYPE_SH7722
select CPU_SH4AL_DSP
select CPU_SHX2
select ARCH_SHMOBILE
- select ARCH_SPARSEMEM_ENABLE
- select SYS_SUPPORTS_NUMA
select SYS_SUPPORTS_SH_CMT
select PINCTRL
@@ -487,8 +481,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 [flat|nested] 14+ messages in thread* [PATCH 10/10] sh: drop include/asm/sparsemem.h
2026-04-13 10:46 [PATCH 00/10] sh: remove NUMA and SPARSEMEM support Mike Rapoport
` (8 preceding siblings ...)
2026-04-13 10:46 ` [PATCH 09/10] sh: remove SPARSEMEM related entries from Kconfig Mike Rapoport
@ 2026-04-13 10:46 ` Mike Rapoport
2026-04-13 10:57 ` [PATCH 00/10] sh: remove NUMA and SPARSEMEM support John Paul Adrian Glaubitz
2026-04-13 11:14 ` Arnd Bergmann
11 siblings, 0 replies; 14+ messages in thread
From: Mike Rapoport @ 2026-04-13 10:46 UTC (permalink / raw)
To: linux-sh
Cc: Andrew Morton, Arnd Bergmann, John Paul Adrian Glaubitz,
Mike Rapoport, Rich Felker, Yoshinori Sato, linux-kernel,
linux-mm
From: "Mike Rapoport (Microsoft)" <rppt@kernel.org>
Move MAX_PHYSMEM_BITS declaration to include/asm/mmu.h and drop now
unneeded include/asm/sparsemem.h
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(-)
delete mode 100644 arch/sh/include/asm/sparsemem.h
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 [flat|nested] 14+ messages in thread* Re: [PATCH 00/10] sh: remove NUMA and SPARSEMEM support
2026-04-13 10:46 [PATCH 00/10] sh: remove NUMA and SPARSEMEM support Mike Rapoport
` (9 preceding siblings ...)
2026-04-13 10:46 ` [PATCH 10/10] sh: drop include/asm/sparsemem.h Mike Rapoport
@ 2026-04-13 10:57 ` John Paul Adrian Glaubitz
2026-04-13 11:10 ` Mike Rapoport
2026-04-13 11:14 ` Arnd Bergmann
11 siblings, 1 reply; 14+ messages in thread
From: John Paul Adrian Glaubitz @ 2026-04-13 10:57 UTC (permalink / raw)
To: Mike Rapoport, linux-sh
Cc: Andrew Morton, Arnd Bergmann, Rich Felker, Yoshinori Sato,
linux-kernel, linux-mm
Hi Mike,
On Mon, 2026-04-13 at 13:46 +0300, Mike Rapoport wrote:
> 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.
>
> 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
Thanks a lot for the series. It will take me some time to review and I expect
it to be taken for v7.2. FWIW, I actually own several boards using the SH-7785LCR
CPU and I issues booting kernels newer than 6.5 on these so I'm wondering whether
this broken feature might be to blame?
Adrian
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH 00/10] sh: remove NUMA and SPARSEMEM support
2026-04-13 10:57 ` [PATCH 00/10] sh: remove NUMA and SPARSEMEM support John Paul Adrian Glaubitz
@ 2026-04-13 11:10 ` Mike Rapoport
0 siblings, 0 replies; 14+ messages in thread
From: Mike Rapoport @ 2026-04-13 11:10 UTC (permalink / raw)
To: John Paul Adrian Glaubitz
Cc: linux-sh, Andrew Morton, Arnd Bergmann, Rich Felker,
Yoshinori Sato, linux-kernel, linux-mm
Hi Adrian,
On Mon, Apr 13, 2026 at 12:57:49PM +0200, John Paul Adrian Glaubitz wrote:
> Hi Mike,
>
> On Mon, 2026-04-13 at 13:46 +0300, Mike Rapoport wrote:
> > 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.
> >
> > 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
>
> Thanks a lot for the series. It will take me some time to review and I expect
> it to be taken for v7.2.
Yes, this for v7.2.
> FWIW, I actually own several boards using the SH-7785LCR CPU and I issues
> booting kernels newer than 6.5 on these so I'm wondering whether this
> broken feature might be to blame?
If 6.5 boots successfully, I don't think this is related.
> Adrian
--
Sincerely yours,
Mike.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 00/10] sh: remove NUMA and SPARSEMEM support
2026-04-13 10:46 [PATCH 00/10] sh: remove NUMA and SPARSEMEM support Mike Rapoport
` (10 preceding siblings ...)
2026-04-13 10:57 ` [PATCH 00/10] sh: remove NUMA and SPARSEMEM support John Paul Adrian Glaubitz
@ 2026-04-13 11:14 ` Arnd Bergmann
11 siblings, 0 replies; 14+ messages in thread
From: Arnd Bergmann @ 2026-04-13 11:14 UTC (permalink / raw)
To: Mike Rapoport, linux-sh
Cc: Andrew Morton, John Paul Adrian Glaubitz, Rich Felker,
Yoshinori Sato, linux-kernel, linux-mm
On Mon, Apr 13, 2026, at 12:46, Mike Rapoport wrote:
>
> 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.
I had looked at it when you asked me about it last year, and I can
confirm that agree with all your findings and the resulting patches.
Whole series
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Two very minor points:
* It looks like you left the 'config SYS_SUPPORTS_NUMA' symbol
in Kconfig, which no longer does anything, so this should probably
be removed in patch 9 along with the lines that select it.
* It appears that after your series, RISC-V is the only remaining
architecture that supports NUMA in 32-bit mode, which I think
we should not allow as a configuration, given that this would
run into untested code and no hardware exists for it.
Apparently commit 4f0e8eef772e ("riscv: Add numa support for
riscv64 platform") intended this to only be for 64-bit targets
but did not add a Kconfig dependency for CONFIG_64BIT (or
CONFIG_SMP, which was added later).
Arnd
^ permalink raw reply [flat|nested] 14+ messages in thread