]> git.ipfire.org Git - thirdparty/openwrt.git/commit
x86: make CONFIG_NR_CPUS a tunable (2-512)
authorJohn Audia <therealgraysky@proton.me>
Sun, 4 Jan 2026 15:31:43 +0000 (10:31 -0500)
committerRobert Marko <robimarko@gmail.com>
Sat, 28 Mar 2026 10:51:11 +0000 (11:51 +0100)
commit65d36329e36aee26629036c96a998fb507a74379
tree8ca225edc653d50cdc0657e3d6cdc7efa678e4a2
parentc9075798cca162962f4472ebe793a3fddc940a35
x86: make CONFIG_NR_CPUS a tunable (2-512)

Add KERNEL_NR_CPUS option in Global build settings → Kernel build
options, allowing users to set maximum CPU count (2-512) for the image.

Defaults:
- x86_64: 512 CPUs (backward compatible)
- x86: 8 CPUs (fix broken single-CPU default)

Per-CPU data structures consume ~100-200KB each.
On a 4-core system configured to NR_CPUS=4, this frees approx 76 MB
of RAM: (512 - 4) × 150 KB = ~76 MB

Note: CONFIG_NR_CPUS_RANGE_{BEGIN,END}= and CONFIG_NR_CPUS_DEFAULT= are
set by the build system and will default to 2/512/64 per arch/x86/Kconfig
These are harmless metadata and don't affect memory allocation.

Note pending https://github.com/openwrt/openwrt/pull/21407

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/21078
Signed-off-by: Robert Marko <robimarko@gmail.com>
config/Config-kernel.in
target/linux/x86/config-6.18