Get the latest tech news
Linus Torvalds Demotes "FORCE_NR_CPUS" Embedded Linux Option To Avoid Confusion
The Linux kernel 'FORCE_NR_CPUS' Kconfig option has been around a few years to force the number of CPU cores the kernel expects in order to allow for better compiler optimizations
Which led Linus Torvalds to reflect: Yeah, that warning very much means "you aren't running a valid config". It improves bitmask op code generation a tiny bit (quite a lot actually on a micro level, but not necessarily hugely noticeable in the big picture) by making nr_cpu_ids a compile-time constant, but it's such a special-case embedded-only (or "tuned for my particular machine") option that it's just not worth it. In turn Torvalds then pushed this commit to further restrict FORCE_NR_CPUS: Hardcoding the number of CPUs at compile time does improve code generation, but if you get it wrong the result will be confusion.
Or read this on Phoronix