lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAP-5=fX3YDUUZm9K82fxw5a_LYfXh6uYF7HRJ=c4xMwJ1=cXCA@mail.gmail.com>
Date: Mon, 6 Oct 2025 14:20:47 -0700
From: Ian Rogers <irogers@...gle.com>
To: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Thomas Falcon <thomas.falcon@...el.com>, Namhyung Kim <namhyung@...nel.org>, 
	Jiri Olsa <jolsa@...nel.org>, Song Liu <songliubraving@...com>, bpf@...r.kernel.org, 
	linux-kernel@...r.kernel.org, linux-perf-users@...r.kernel.org, 
	Howard Chu <howardchu95@...il.com>, Gabriele Monaco <gmonaco@...hat.com>, 
	Athira Rajeev <atrajeev@...ux.vnet.ibm.com>, James Clark <james.clark@...aro.org>, 
	Alexander Shishkin <alexander.shishkin@...ux.intel.com>, 
	Adrian Hunter <adrian.hunter@...el.com>, Tengda Wu <wutengda@...weicloud.com>, 
	Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>
Subject: Re: [PATCH v1 2/2] perf bpf_counter: Fix handling of cpumap fixing hybrid

On Mon, Oct 6, 2025 at 12:57 PM Arnaldo Carvalho de Melo
<acme@...nel.org> wrote:
>
> On Mon, Oct 06, 2025 at 09:18:22AM -0700, Ian Rogers wrote:
> > On Wed, Oct 1, 2025 at 11:12 AM Ian Rogers <irogers@...gle.com> wrote:
> > >
> > > Don't open evsels on all CPUs, open them just on the CPUs they
> > > support. This avoids opening say an e-core event on a p-core and
> > > getting a failure - achieve this by getting rid of the "all_cpu_map".
> > >
> > > In install_pe functions don't use the cpu_map_idx as a CPU number,
> > > translate the cpu_map_idx, which is a dense index into the cpu_map
> > > skipping holes at the beginning, to a proper CPU number.
> > >
> > > Before:
> > > ```
> > > $ perf stat --bpf-counters -a -e cycles,instructions -- sleep 1
> > >
> > >  Performance counter stats for 'system wide':
> > >
> > >    <not supported>      cpu_atom/cycles/
> > >        566,270,672      cpu_core/cycles/
> > >    <not supported>      cpu_atom/instructions/
> > >        572,792,836      cpu_core/instructions/           #    1.01  insn per cycle
> > >
> > >        1.001595384 seconds time elapsed
> > > ```
> > >
> > > After:
> > > ```
> > > $ perf stat --bpf-counters -a -e cycles,instructions -- sleep 1
> > >
> > >  Performance counter stats for 'system wide':
> > >
> > >        443,299,201      cpu_atom/cycles/
> > >      1,233,919,737      cpu_core/cycles/
> > >        213,634,112      cpu_atom/instructions/           #    0.48  insn per cycle
> > >      2,758,965,527      cpu_core/instructions/           #    2.24  insn per cycle
> > >
> > >        1.001699485 seconds time elapsed
> > > ```
> > >
> > > Fixes: 7fac83aaf2ee ("perf stat: Introduce 'bperf' to share hardware PMCs with BPF")
> > > Signed-off-by: Ian Rogers <irogers@...gle.com>
> >
> > +Thomas Falcon
> >
> > I think it'd be nice to get this quite major fix for
> > --bpf-counters/bperf for hybrid architectures into v6.18 and stable
> > builds. Thomas would it be possible for you to give a Tested-by tag
> > using the reproduction in the commit message?
>
> Its even already in linux-next:
>
> ⬢ [acme@...lbx perf-tools-next]$ git log -5 --oneline linux-next/master tools/perf/util/bpf_counter.c
> b91917c0c6fa6df9 perf bpf_counter: Fix handling of cpumap fixing hybrid
> 8c519a825b4add85 perf bpf_counter: Move header declarations into C code
> 07dc3a6de33098b0 perf stat: Support inherit events during fork() for bperf
> effe957c6bb70cac libperf cpumap: Replace usage of perf_cpu_map__new(NULL) with perf_cpu_map__new_online_cpus()
> b84b3f47921568a8 perf bpf_counter: Fix a few memory leaks
> ⬢ [acme@...lbx perf-tools-next]$

Oh, thanks! Sorry for missing it. Thanks Thomas for the tag!

Ian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ