Re: [PATCH] riscv: Raise default NR_CPUS for 64BIT to 256
From: Paul Walmsley
Date: Thu Jun 25 2026 - 13:50:32 EST
On Thu, 25 Jun 2026, Vivian Wang wrote:
> 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@xxxxxxxxxxxx>
> Link: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1140651 # [1]
> Suggested-by: Han Gao <gaohan@xxxxxxxxxxx>
> Signed-off-by: Vivian Wang <wangruikang@xxxxxxxxxxx>
Thanks, queued for v7.2-rc.
- Paul