Commit 65d3632
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 openwrt/openwrt#21407
Signed-off-by: John Audia <therealgraysky@proton.me>
Link: openwrt/openwrt#21078
Signed-off-by: Robert Marko <robimarko@gmail.com>1 parent c907579 commit 65d3632
2 files changed
Lines changed: 20 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
67 | 87 | | |
68 | 88 | | |
69 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
328 | 328 | | |
329 | 329 | | |
330 | 330 | | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | 331 | | |
336 | 332 | | |
337 | 333 | | |
| |||
0 commit comments