Linux Perf Users
 help / color / mirror / Atom feed
* [PATCH 0/3] perf/core: order three publications against their readers
@ 2026-09-22  1:13 Jaidev Shastri via B4 Relay
  2026-09-22  1:13 ` [PATCH 1/3] perf/core: publish the aux_event link with release semantics Jaidev Shastri via B4 Relay
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Jaidev Shastri via B4 Relay @ 2026-09-22  1:13 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Ian Rogers, Adrian Hunter, James Clark
  Cc: linux-perf-users, linux-kernel, Jaidev Shastri

Three plain publications in kernel/events/core.c are read by paths running on
other CPUs: the aux_output link set in perf_get_aux_event() and read from the
PMU interrupt, the guest callbacks installed by
perf_register_guest_info_callbacks() and tested through perf_guest_state()
before perf_guest_get_ip() is called, and perf_event_cache read by
free_event_rcu().

The guest callback case is the one with a visible symptom. Without
CONFIG_HAVE_STATIC_CALL, which arm64 selects only under CFI, a static call is
a plain load of key->func, so a PMI on another CPU can observe the new state
callback while get_ip still resolves to the RET0 default and report an
instruction pointer of zero for a guest sample. The callees are now installed
before the gate, separated by a write barrier.

The other two are ordered in practice by the ctx->lock hand-off at schedule-in
and by initialisation order, and those patches make the publication explicit.

Found with MBCheck, a static herd7-based memory consistency checker.
Compile-tested on arm64 with W=1, no new warnings.

---
Jaidev Shastri (3):
      perf/core: publish the aux_event link with release semantics
      perf/core: install the guest callbacks before the guest_state gate
      perf/core: publish perf_event_cache with release semantics

 kernel/events/core.c | 28 ++++++++++++++++++++++------
 1 file changed, 22 insertions(+), 6 deletions(-)
---
base-commit: 93f51579e7df248780214094418f205253383cc5
change-id: 20260921-mb-perf-core-5067a1ab3ca3

Best regards,
--  
Jaidev Shastri <jaidevshastri@vt.edu>



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

end of thread, other threads:[~2026-09-22  1:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-22  1:13 [PATCH 0/3] perf/core: order three publications against their readers Jaidev Shastri via B4 Relay
2026-09-22  1:13 ` [PATCH 1/3] perf/core: publish the aux_event link with release semantics Jaidev Shastri via B4 Relay
2026-09-22  1:24   ` sashiko-bot
2026-09-22  1:13 ` [PATCH 2/3] perf/core: install the guest callbacks before the guest_state gate Jaidev Shastri via B4 Relay
2026-09-22  1:25   ` sashiko-bot
2026-09-22  1:13 ` [PATCH 3/3] perf/core: publish perf_event_cache with release semantics Jaidev Shastri via B4 Relay
2026-09-22  1:24   ` sashiko-bot

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