* [PATCH 0/1] allow trace events to be accessed from any CPU
@ 2026-05-28 0:51 Junxiao Chang
2026-05-28 0:51 ` [PATCH 1/1] perf/core: " Junxiao Chang
0 siblings, 1 reply; 2+ messages in thread
From: Junxiao Chang @ 2026-05-28 0:51 UTC (permalink / raw)
To: peterz, mingo, acme, namhyung, mark.rutland, alexander.shishkin,
jolsa, irogers, adrian.hunter, james.clark, linux-perf-users,
linux-kernel
Cc: bigeasy, junxiao.chang
The issue was reproduced while debugging real-time scheduling
performance. An extra SMP IPI is triggered when using perf stat
to collect trace event statistics.
Trace events should be accessible from any CPU without requiring
an IPI when the current CPU differs from the event CPU.
Set the trace event PMU scope to PERF_PMU_SCOPE_SYS_WIDE so that
trace events can be accessed system-wide. With this change, no
extra SMP IPI is triggered even when the current CPU differs from
the event CPU.
Junxiao Chang (1):
perf/core: allow trace events to be accessed from any CPU
kernel/events/core.c | 1 +
1 file changed, 1 insertion(+)
--
2.43.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 1/1] perf/core: allow trace events to be accessed from any CPU
2026-05-28 0:51 [PATCH 0/1] allow trace events to be accessed from any CPU Junxiao Chang
@ 2026-05-28 0:51 ` Junxiao Chang
0 siblings, 0 replies; 2+ messages in thread
From: Junxiao Chang @ 2026-05-28 0:51 UTC (permalink / raw)
To: peterz, mingo, acme, namhyung, mark.rutland, alexander.shishkin,
jolsa, irogers, adrian.hunter, james.clark, linux-perf-users,
linux-kernel
Cc: bigeasy, junxiao.chang
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@intel.com>
---
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-05-27 0:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-28 0:51 [PATCH 0/1] allow trace events to be accessed from any CPU Junxiao Chang
2026-05-28 0:51 ` [PATCH 1/1] perf/core: " Junxiao Chang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®