linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/1] perf: Fix warning from concurrent read/write of perf_event_pmu_context
@ 2023-01-27 14:31 James Clark
  2023-01-27 14:31 ` [PATCH 1/1] " James Clark
  0 siblings, 1 reply; 6+ messages in thread
From: James Clark @ 2023-01-27 14:31 UTC (permalink / raw)
  To: linux-perf-users, peterz, ravi.bangoria
  Cc: James Clark, Ingo Molnar, Arnaldo Carvalho de Melo, Mark Rutland,
	Alexander Shishkin, Jiri Olsa, Namhyung Kim, linux-kernel

Hi Peter and Ravi,

I came across this issue, and I also found there was a syzbot report
for it and linked it on the commit. I have one question about the fix,
where I had to remove the if (epc->ctx) from put_pmu_ctx(). I assume
this was added for a reason, but I can't see where it's not ever set?
Unless it's removed, the function got a lot more complicated to take
the lock before the reference decrement.

Also now I think the atomic type for epc->refcount is redundant,
because everything is always done with the lock held. Except for
get_pmu_ctx(), but that is just a read for a warning. So unless you
think the scope of my extra locking can be reduced, I would probably
also send a commit to remove that as well.

Thanks
James

James Clark (1):
  perf: Fix warning from concurrent read/write of perf_event_pmu_context

 kernel/events/core.c | 42 ++++++++++++++++++++----------------------
 1 file changed, 20 insertions(+), 22 deletions(-)


base-commit: 5912e15f25d6d584f3b8449e0b6a244a0f4f0903
-- 
2.39.1


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

end of thread, other threads:[~2023-02-01 10:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-27 14:31 [PATCH 0/1] perf: Fix warning from concurrent read/write of perf_event_pmu_context James Clark
2023-01-27 14:31 ` [PATCH 1/1] " James Clark
2023-01-30  5:49   ` Ravi Bangoria
2023-01-31  8:25     ` Ravi Bangoria
2023-01-31 13:31   ` Peter Zijlstra
2023-02-01 10:49     ` James Clark

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).