BPF List
 help / color / mirror / Atom feed
* [PATCH RESEND] perf: Completely remove possibility to override MAX_NR_CPUS
@ 2025-08-18  9:57 Christophe Leroy
  2025-09-12  8:32 ` Christophe Leroy
  0 siblings, 1 reply; 3+ messages in thread
From: Christophe Leroy @ 2025-08-18  9:57 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Ian Rogers, Adrian Hunter, Liang, Kan, Leo Yan
  Cc: Christophe Leroy, linux-perf-users, linux-kernel, bpf

Commit 21b8732eb447 ("perf tools: Allow overriding MAX_NR_CPUS at
compile time") added the capability to override MAX_NR_CPUS. At
that time it was necessary to reduce the huge amount of RAM used
by static stats variables.

But this has been unnecessary since commit 6a1e2c5c2673 ("perf stat:
Remove a set of shadow stats static variables"), and
commit e8399d34d568 ("libperf cpumap: Hide/reduce scope of
MAX_NR_CPUS") broke the build in that case because it failed to
add the guard around the new definition of MAX_NR_CPUS.

So cleanup things and remove guards completely to officialise it
is not necessary anymore to override MAX_NR_CPUS.

Link: https://lore.kernel.org/all/8c8553387ebf904a9e5a93eaf643cb01164d9fb3.1736188471.git.christophe.leroy@csgroup.eu/
Fixes: e8399d34d568 ("libperf cpumap: Hide/reduce scope of MAX_NR_CPUS")
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
 tools/perf/perf.h                        | 2 --
 tools/perf/util/bpf_skel/kwork_top.bpf.c | 2 --
 2 files changed, 4 deletions(-)

diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index 3cb40965549f..e004178472d9 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -2,9 +2,7 @@
 #ifndef _PERF_PERF_H
 #define _PERF_PERF_H
 
-#ifndef MAX_NR_CPUS
 #define MAX_NR_CPUS			4096
-#endif
 
 enum perf_affinity {
 	PERF_AFFINITY_SYS = 0,
diff --git a/tools/perf/util/bpf_skel/kwork_top.bpf.c b/tools/perf/util/bpf_skel/kwork_top.bpf.c
index 73e32e063030..6673386302e2 100644
--- a/tools/perf/util/bpf_skel/kwork_top.bpf.c
+++ b/tools/perf/util/bpf_skel/kwork_top.bpf.c
@@ -18,9 +18,7 @@ enum kwork_class_type {
 };
 
 #define MAX_ENTRIES     102400
-#ifndef MAX_NR_CPUS
 #define MAX_NR_CPUS     4096
-#endif
 #define PF_KTHREAD      0x00200000
 #define MAX_COMMAND_LEN 16
 
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH RESEND] perf: Completely remove possibility to override MAX_NR_CPUS
  2025-08-18  9:57 [PATCH RESEND] perf: Completely remove possibility to override MAX_NR_CPUS Christophe Leroy
@ 2025-09-12  8:32 ` Christophe Leroy
  2025-09-12 19:35   ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 3+ messages in thread
From: Christophe Leroy @ 2025-09-12  8:32 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Ian Rogers, Adrian Hunter, Liang, Kan, Leo Yan
  Cc: linux-perf-users, linux-kernel, bpf

Le 18/08/2025 à 11:57, Christophe Leroy a écrit :
> Commit 21b8732eb447 ("perf tools: Allow overriding MAX_NR_CPUS at
> compile time") added the capability to override MAX_NR_CPUS. At
> that time it was necessary to reduce the huge amount of RAM used
> by static stats variables.
> 
> But this has been unnecessary since commit 6a1e2c5c2673 ("perf stat:
> Remove a set of shadow stats static variables"), and
> commit e8399d34d568 ("libperf cpumap: Hide/reduce scope of
> MAX_NR_CPUS") broke the build in that case because it failed to
> add the guard around the new definition of MAX_NR_CPUS.
> 
> So cleanup things and remove guards completely to officialise it
> is not necessary anymore to override MAX_NR_CPUS.
> 
> Link: https://lore.kernel.org/all/8c8553387ebf904a9e5a93eaf643cb01164d9fb3.1736188471.git.christophe.leroy@csgroup.eu/
> Fixes: e8399d34d568 ("libperf cpumap: Hide/reduce scope of MAX_NR_CPUS")
> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>

Gentle ping

Thanks
Christophe

> ---
>   tools/perf/perf.h                        | 2 --
>   tools/perf/util/bpf_skel/kwork_top.bpf.c | 2 --
>   2 files changed, 4 deletions(-)
> 
> diff --git a/tools/perf/perf.h b/tools/perf/perf.h
> index 3cb40965549f..e004178472d9 100644
> --- a/tools/perf/perf.h
> +++ b/tools/perf/perf.h
> @@ -2,9 +2,7 @@
>   #ifndef _PERF_PERF_H
>   #define _PERF_PERF_H
>   
> -#ifndef MAX_NR_CPUS
>   #define MAX_NR_CPUS			4096
> -#endif
>   
>   enum perf_affinity {
>   	PERF_AFFINITY_SYS = 0,
> diff --git a/tools/perf/util/bpf_skel/kwork_top.bpf.c b/tools/perf/util/bpf_skel/kwork_top.bpf.c
> index 73e32e063030..6673386302e2 100644
> --- a/tools/perf/util/bpf_skel/kwork_top.bpf.c
> +++ b/tools/perf/util/bpf_skel/kwork_top.bpf.c
> @@ -18,9 +18,7 @@ enum kwork_class_type {
>   };
>   
>   #define MAX_ENTRIES     102400
> -#ifndef MAX_NR_CPUS
>   #define MAX_NR_CPUS     4096
> -#endif
>   #define PF_KTHREAD      0x00200000
>   #define MAX_COMMAND_LEN 16
>   


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH RESEND] perf: Completely remove possibility to override MAX_NR_CPUS
  2025-09-12  8:32 ` Christophe Leroy
@ 2025-09-12 19:35   ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2025-09-12 19:35 UTC (permalink / raw)
  To: Christophe Leroy
  Cc: Peter Zijlstra, Ingo Molnar, Namhyung Kim, Mark Rutland,
	Alexander Shishkin, Jiri Olsa, Ian Rogers, Adrian Hunter,
	Liang, Kan, Leo Yan, linux-perf-users, linux-kernel, bpf

On Fri, Sep 12, 2025 at 10:32:56AM +0200, Christophe Leroy wrote:
> Le 18/08/2025 à 11:57, Christophe Leroy a écrit :
> > Commit 21b8732eb447 ("perf tools: Allow overriding MAX_NR_CPUS at
> > compile time") added the capability to override MAX_NR_CPUS. At
> > that time it was necessary to reduce the huge amount of RAM used
> > by static stats variables.
> > 
> > But this has been unnecessary since commit 6a1e2c5c2673 ("perf stat:
> > Remove a set of shadow stats static variables"), and
> > commit e8399d34d568 ("libperf cpumap: Hide/reduce scope of
> > MAX_NR_CPUS") broke the build in that case because it failed to
> > add the guard around the new definition of MAX_NR_CPUS.
> > 
> > So cleanup things and remove guards completely to officialise it
> > is not necessary anymore to override MAX_NR_CPUS.
> > 
> > Link: https://lore.kernel.org/all/8c8553387ebf904a9e5a93eaf643cb01164d9fb3.1736188471.git.christophe.leroy@csgroup.eu/
> > Fixes: e8399d34d568 ("libperf cpumap: Hide/reduce scope of MAX_NR_CPUS")
> > Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> 
> Gentle ping

Thanks, applied to perf-tools-next,

- Arnaldo

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-09-12 19:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-18  9:57 [PATCH RESEND] perf: Completely remove possibility to override MAX_NR_CPUS Christophe Leroy
2025-09-12  8:32 ` Christophe Leroy
2025-09-12 19:35   ` Arnaldo Carvalho de Melo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox