Skip to content

Commit 9f0bff1

Browse files
Sebastian Andrzej SiewiorPeter Zijlstra
authored andcommitted
perf/core: Add SRCU annotation for pmus list walk
Since commit 2887594 ("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 <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: Joel Fernandes (Google) <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 92ca7da commit 9f0bff1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/events/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10523,7 +10523,7 @@ static struct pmu *perf_init_event(struct perf_event *event)
1052310523
goto unlock;
1052410524
}
1052510525

10526-
list_for_each_entry_rcu(pmu, &pmus, entry) {
10526+
list_for_each_entry_rcu(pmu, &pmus, entry, lockdep_is_held(&pmus_srcu)) {
1052710527
ret = perf_try_init_event(pmu, event);
1052810528
if (!ret)
1052910529
goto unlock;

0 commit comments

Comments
 (0)