Perf Support For 2,048 CPU Cores Is Becoming Not Enough - Patches Bump Kernel Limit

Written by Michael Larabel in Linux Kernel on 10 December 2024 at 10:41 AM EST. 23 Comments
LINUX KERNEL
Currently the Linux kernel's "perf" performance monitoring subsystem has a limit on 2,048 CPU cores for its CPU map that is set by the MAX_NR_CPUS value. But that's becoming not enough in today's high core count era that patches are looking to raise it to a 4,096 CPU core limit by default.

HPE and Google engineers are hitting the 2,048 CPU core limit set by MAX_NR_CPUS for the perf CPU map. So along with some other improvements a pending patch series would raise the limit to 4,096 CPU cores.

Bumping MAX_NR_CPUS


While we are seeing high core count server CPUs these days from AMD, Intel, and Ampere, among others, in the case of exceeding 2,048 CPUs with this perf issue being encountered is reportedly being experienced on a 32 socket Xeon 6 "Granite Rapids" server that is hitting 2,048+ logical CPUs.
"Prompted by Kyle Meyer's report of the MAX_NR_CPUS value being too small, initiate some clean up of its use. Kyle's patch is at the head of the series. The additional patches hide MAX_NR_CPUS as exposed from cpumap.h, reduce its use by removing perf_cpu_map__read, and try to better size the temporary CPU array in perf_cpu_map__new.
...
Systems have surpassed 2048 CPUs. Increase MAX_NR_CPUS to 4096."

This patch series is going into perf-tools-next and thus raising this limit should be in place for the upcoming Linux 6.14 kernel cycle.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week