perf: Increase MAX_NR_CPUS to 4096
PATCH 1/1 perf: Increase MAX_NR_CPUS to 4096
Systems have surpassed 2048 CPUs. Increase MAX_NR_CPUS to 4096.
Bitmaps declared with MAX_NR_CPUS bits will increase from 256B to 512B, and cpus_runtime will increase from 81960B to 163880B.
---
Tested on a 32 socket Sapphire Rapids system with 3840 CPUs.
tools/lib/perf/include/internal/cpumap.h | 2 +- tools/perf/perf.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
tools/lib/perf/include/internal/cpumap.h +1 -1
@@ -22,7 +22,7 @@ DECLARE_RC_STRUCT(perf_cpu_map) { };#ifndef MAX_NR_CPUS -#define MAX_NR_CPUS 2048 +#define MAX_NR_CPUS 4096#endif struct perf_cpu_map *perf_cpu_map__alloc (int nr_cpus);
tools/perf/perf.h +1 -1
@@ -3,7 +3,7 @@#define _PERF_PERF_H#ifndef MAX_NR_CPUS -#define MAX_NR_CPUS 2048 +#define MAX_NR_CPUS 4096#endif enum perf_affinity {
Signature · 1 line
2.47.1
Ian Rogers
reviewerQuoted 7 lines · Kyle Meyer
Systems have surpassed 2048 CPUs. Increase
MAX_NR_CPUSto 4096.Bitmaps declared with
MAX_NR_CPUSbits will increase from 256B to 512B, andcpus_runtimewill increase from 81960B to 163880B.Signed-off-by Kyle Meyer <[email protected]>
This is very interesting, thanks Kyle! Just noting, having the same #define in many places is clearly error prone and there are other redefinitions of this value:
https://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git/tree/tools/perf/util/bpf_skel/kwork_top.bpf.c?h=perf-tools-next#n21
I wonder I can refactor tools/lib/perf/cpumap.c to get rid of that constant as it is only used when parsing from a file/string.
Could the kwork developers perhaps look at their many uses? The other uses in the tool may be removable too.
Wrt this change, perhaps bump tools/perf/util/bpf_skel/kwork_top.bpf.c too and then we merge that while trying to remove other uses.
Thanks,
Ian
Quoted 37 lines
---
Tested on a 32 socket Sapphire Rapids system with 3840 CPUs.
tools/lib/perf/include/internal/cpumap.h | 2 +- tools/perf/perf.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)tools/lib/perf/include/internal/cpumap.h +1
-1@@ -22,7 +22,7 @@ DECLARE_RC_STRUCT(perf_cpu_map) { };#ifndef MAX_NR_CPUS -#define MAX_NR_CPUS 2048 +#define MAX_NR_CPUS 4096#endif struct perf_cpu_map *perf_cpu_map__alloc (int nr_cpus);tools/perf/perf.h +1
-2@@ -3,7 +3,7 @@#define _PERF_PERF_H#ifndef MAX_NR_CPUS -#define MAX_NR_CPUS 2048 +#define MAX_NR_CPUS 4096#endif enum perf_affinity { --2.47.1
Quoted 17 lines · Ian Rogers
Quoted 7 lines · Kyle Meyer
Systems have surpassed 2048 CPUs. Increase
MAX_NR_CPUSto 4096.Bitmaps declared with
MAX_NR_CPUSbits will increase from 256B to 512B, andcpus_runtimewill increase from 81960B to 163880B.Signed-off-by Kyle Meyer <[email protected]>This is very interesting, thanks Kyle! Just noting, having the same #define in many places is clearly error prone and there are other redefinitions of this value:
https://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git/tree/tools/perf/util/bpf_skel/kwork_top.bpf.c?h=perf-tools-next#n21I wonder I can refactor
tools/lib/perf/cpumap.cto get rid of that constant as it is only used when parsing from a file/string.
Quoted 6 lines
Could the kwork developers perhaps look at their many uses? The other uses in the tool may be removable too.
Wrt this change, perhaps bump
tools/perf/util/bpf_skel/kwork_top.bpf.ctoo and then we merge that while trying to remove other uses.
Sure, that sounds good to me. I'll send a second version.
Thanks,
Kyle Meyer
Quoted 37 lines
Quoted 37 lines
---
Tested on a 32 socket Sapphire Rapids system with 3840 CPUs.
tools/lib/perf/include/internal/cpumap.h | 2 +- tools/perf/perf.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)tools/lib/perf/include/internal/cpumap.h +1
-1@@ -22,7 +22,7 @@ DECLARE_RC_STRUCT(perf_cpu_map) { };#ifndef MAX_NR_CPUS -#define MAX_NR_CPUS 2048 +#define MAX_NR_CPUS 4096#endif struct perf_cpu_map *perf_cpu_map__alloc (int nr_cpus);tools/perf/perf.h +1
-2@@ -3,7 +3,7 @@#define _PERF_PERF_H#ifndef MAX_NR_CPUS -#define MAX_NR_CPUS 2048 +#define MAX_NR_CPUS 4096#endif enum perf_affinity { --2.47.1