summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorVivian Wang <wangruikang@iscas.ac.cn>2026-06-25 14:34:15 +0800
committerPaul Walmsley <pjw@kernel.org>2026-06-25 11:41:15 -0600
commit0fa749771993033befb9dda60b023782cb5fd2d9 (patch)
treeee12479e94febb882c359cf1961d8ca2ba674fe9 /arch
parentc75597caada080effbfbc0a7fb10dc2a3bb543ad (diff)
downloadlinux-2.6-0fa749771993033befb9dda60b023782cb5fd2d9.tar.gz
linux-2.6-0fa749771993033befb9dda60b023782cb5fd2d9.zip
riscv: Raise default NR_CPUS for 64BIT to 256
SpacemiT has already produced a 80-core RVA23 RISC-V server [1], and going further back, the dual-socket SG2042-based Sophgo Pisces has 128 cores (although that had some issues achieving mainline support). Therefore, an NR_CPUS of 64 is not enough. Raise default NR_CPUS to 256 for 64BIT (when !RISCV_SBI_V01, since very old firmware can't support more than 64 cores). The number was picked as a power of two that is at least double the known max. I believe this should be the right balance between not wasting too much memory and not having to touch this too often. Ubuntu has already been shipping NR_CPUS=512 for riscv64. We have also been testing NR_CPUS=256 internally at ISCAS and found negligible performance impact and no ill effects. Reported-by: Lufei Zheng <lufei.zheng@spacemit.com> Link: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1140651 # [1] Suggested-by: Han Gao <gaohan@iscas.ac.cn> Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn> Link: https://patch.msgid.link/20260625-riscv-more-nr-cpus-v1-1-5da8c72b9269@iscas.ac.cn Signed-off-by: Paul Walmsley <pjw@kernel.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/riscv/Kconfig3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index 3f0a647218e4..c0a6992933e4 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -454,7 +454,8 @@ config NR_CPUS
range 2 32 if RISCV_SBI_V01 && 32BIT
range 2 64 if RISCV_SBI_V01 && 64BIT
default "32" if 32BIT
- default "64" if 64BIT
+ default "64" if RISCV_SBI_V01 && 64BIT
+ default "256" if !RISCV_SBI_V01 && 64BIT
config HOTPLUG_CPU
bool "Support for hot-pluggable CPUs"