Re: [PATCH 1/1] perf/core: allow trace events to be accessed from any CPU

From: Ian Rogers

Date: Tue Sep 15 2026 - 16:42:00 EST


On Tue, May 26, 2026 at 5:57 PM Junxiao Chang <junxiao.chang@xxxxxxxxx> wrote:
>
> Using perf to collect trace event statistics may introduce unnecessary
> SMP IPI interrupts. For example:
>
> perf stat -e i915:i915_context_create -I 1000
>
> In perf_event_read(), an SMP IPI is triggered when the event CPU
> differs from the local CPU.
>
> Allow trace events to be accessed from any CPU so the event CPU can
> be set to the local CPU, eliminating the extra IPI overhead.
>
> Signed-off-by: Junxiao Chang <junxiao.chang@xxxxxxxxx>

Hi Junxiao,

Reducing IPIs is great, but the Sashiko review pointed at a bunch of
issues that seemed like unintended consequences from the change. What
is your plan to address those issues?

Thanks,
Ian

> ---
> kernel/events/core.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/kernel/events/core.c b/kernel/events/core.c
> index acdb1f02924da..b3a817c0eb3a2 100644
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c
> @@ -11376,6 +11376,7 @@ static struct pmu perf_tracepoint = {
> .start = perf_swevent_start,
> .stop = perf_swevent_stop,
> .read = perf_swevent_read,
> + .scope = PERF_PMU_SCOPE_SYS_WIDE,
> };
>
> static int perf_tp_filter_match(struct perf_event *event,
> --
> 2.43.0
>