* [PATCH v2] perf: Increase MAX_NR_CPUS to 4096
@ 2024-12-05 21:04 Kyle Meyer
2024-12-06 4:27 ` Ian Rogers
0 siblings, 1 reply; 2+ messages in thread
From: Kyle Meyer @ 2024-12-05 21:04 UTC (permalink / raw)
To: peterz, mingo, acme, namhyung, mark.rutland, alexander.shishkin,
jolsa, irogers, adrian.hunter, kan.liang, linux-perf-users,
linux-kernel
Cc: Kyle Meyer
Systems have surpassed 2048 CPUs. Increase MAX_NR_CPUS to 4096.
Bitmaps declared with MAX_NR_CPUS bits will increase from 256B to 512B,
cpus_runtime will increase from 81960B to 163880B, and max_entries will
increase from 8192B to 16384B.
Signed-off-by: Kyle Meyer <kyle.meyer@hpe.com>
---
v1 -> v2:
* Increase MAX_NR_CPUS in tools/perf/util/bpf_skel/kwork_top.bpf.c, as
suggested by Ian Rogers.
* https://lore.kernel.org/all/20241205165118.153148-1-kyle.meyer@hpe.com/
tools/lib/perf/include/internal/cpumap.h | 2 +-
tools/perf/perf.h | 2 +-
tools/perf/util/bpf_skel/kwork_top.bpf.c | 4 +++-
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/tools/lib/perf/include/internal/cpumap.h b/tools/lib/perf/include/internal/cpumap.h
index 49649eb51ce4..3cf28522004e 100644
--- a/tools/lib/perf/include/internal/cpumap.h
+++ b/tools/lib/perf/include/internal/cpumap.h
@@ -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);
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index c004dd4e65a3..3cb40965549f 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -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 {
diff --git a/tools/perf/util/bpf_skel/kwork_top.bpf.c b/tools/perf/util/bpf_skel/kwork_top.bpf.c
index 594da91965a2..73e32e063030 100644
--- a/tools/perf/util/bpf_skel/kwork_top.bpf.c
+++ b/tools/perf/util/bpf_skel/kwork_top.bpf.c
@@ -18,7 +18,9 @@ enum kwork_class_type {
};
#define MAX_ENTRIES 102400
-#define MAX_NR_CPUS 2048
+#ifndef MAX_NR_CPUS
+#define MAX_NR_CPUS 4096
+#endif
#define PF_KTHREAD 0x00200000
#define MAX_COMMAND_LEN 16
--
2.35.3
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH v2] perf: Increase MAX_NR_CPUS to 4096
2024-12-05 21:04 [PATCH v2] perf: Increase MAX_NR_CPUS to 4096 Kyle Meyer
@ 2024-12-06 4:27 ` Ian Rogers
0 siblings, 0 replies; 2+ messages in thread
From: Ian Rogers @ 2024-12-06 4:27 UTC (permalink / raw)
To: Kyle Meyer
Cc: peterz, mingo, acme, namhyung, mark.rutland, alexander.shishkin,
jolsa, adrian.hunter, kan.liang, linux-perf-users, linux-kernel
On Thu, Dec 5, 2024 at 1:07 PM Kyle Meyer <kyle.meyer@hpe.com> wrote:
>
> Systems have surpassed 2048 CPUs. Increase MAX_NR_CPUS to 4096.
>
> Bitmaps declared with MAX_NR_CPUS bits will increase from 256B to 512B,
> cpus_runtime will increase from 81960B to 163880B, and max_entries will
> increase from 8192B to 16384B.
>
> Signed-off-by: Kyle Meyer <kyle.meyer@hpe.com>
Reviewed-by: Ian Rogers <irogers@google.com>
Thanks,
Ian
> ---
>
> v1 -> v2:
> * Increase MAX_NR_CPUS in tools/perf/util/bpf_skel/kwork_top.bpf.c, as
> suggested by Ian Rogers.
> * https://lore.kernel.org/all/20241205165118.153148-1-kyle.meyer@hpe.com/
>
> tools/lib/perf/include/internal/cpumap.h | 2 +-
> tools/perf/perf.h | 2 +-
> tools/perf/util/bpf_skel/kwork_top.bpf.c | 4 +++-
> 3 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/tools/lib/perf/include/internal/cpumap.h b/tools/lib/perf/include/internal/cpumap.h
> index 49649eb51ce4..3cf28522004e 100644
> --- a/tools/lib/perf/include/internal/cpumap.h
> +++ b/tools/lib/perf/include/internal/cpumap.h
> @@ -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);
> diff --git a/tools/perf/perf.h b/tools/perf/perf.h
> index c004dd4e65a3..3cb40965549f 100644
> --- a/tools/perf/perf.h
> +++ b/tools/perf/perf.h
> @@ -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 {
> diff --git a/tools/perf/util/bpf_skel/kwork_top.bpf.c b/tools/perf/util/bpf_skel/kwork_top.bpf.c
> index 594da91965a2..73e32e063030 100644
> --- a/tools/perf/util/bpf_skel/kwork_top.bpf.c
> +++ b/tools/perf/util/bpf_skel/kwork_top.bpf.c
> @@ -18,7 +18,9 @@ enum kwork_class_type {
> };
>
> #define MAX_ENTRIES 102400
> -#define MAX_NR_CPUS 2048
> +#ifndef MAX_NR_CPUS
> +#define MAX_NR_CPUS 4096
> +#endif
> #define PF_KTHREAD 0x00200000
> #define MAX_COMMAND_LEN 16
>
> --
> 2.35.3
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-12-06 4:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-05 21:04 [PATCH v2] perf: Increase MAX_NR_CPUS to 4096 Kyle Meyer
2024-12-06 4:27 ` Ian Rogers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox