mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] perf/core: Add SRCU annotation for pmus list walk
@ 2019-11-19 12:14 Sebastian Andrzej Siewior
  2019-11-29 10:31 ` Sebastian Andrzej Siewior
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Sebastian Andrzej Siewior @ 2019-11-19 12:14 UTC (permalink / raw)
  To: linux-kernel, Joel Fernandes, Paul E. McKenney
  Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	Thomas Gleixner

Since commit
   28875945ba98d ("rcu: Add support for consolidated-RCU reader checking")

there is an additional check to ensure that a RCU related lock is held
while the RCU list is iterated.
This section holds the SRCU reader lock instead.

Add annotation to list_for_each_entry_rcu() that pmus_srcu must be
acquired during the list traversal.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---

I see the warning in in v5.4-rc during boot. For some reason I don't see
it in tip/master during boot but "perf stat w" triggers it again (among
other things).

 kernel/events/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index 5224388872069..dbb3b26a55612 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -10497,7 +10497,7 @@ static struct pmu *perf_init_event(struct perf_event *event)
 		goto unlock;
 	}
 
-	list_for_each_entry_rcu(pmu, &pmus, entry) {
+	list_for_each_entry_rcu(pmu, &pmus, entry, lockdep_is_held(&pmus_srcu)) {
 		ret = perf_try_init_event(pmu, event);
 		if (!ret)
 			goto unlock;
-- 
2.24.0


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

end of thread, other threads:[~2019-12-17 13:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-19 12:14 [PATCH] perf/core: Add SRCU annotation for pmus list walk Sebastian Andrzej Siewior
2019-11-29 10:31 ` Sebastian Andrzej Siewior
2019-11-29 20:05 ` Joel Fernandes
2019-12-17 11:48   ` Sebastian Andrzej Siewior
2019-12-17 12:21 ` Peter Zijlstra
2019-12-17 13:03   ` Sebastian Andrzej Siewior
2019-12-17 12:39 ` [tip: perf/urgent] " tip-bot2 for Sebastian Andrzej Siewior

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

Powered by JetHome