Skip to content

perf/core: rcu fixes

Stephane Eranian lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v3 Latest2 patches 1 replyIn review

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2perf/core: fix RCU problem with cgroup context switching codekernel/events/core.c+8 -30 replies
2/2perf/core: robustify perf_cgroup_from_task rcu checksarch/x86/kernel/cpu/perf_event_intel_cqm.c include/linux/perf_event.h kernel/events/core.c+18 -100 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/2] perf/core: rcu fixes

This short patch series fixes some issues with RCU locking in the generic perf layer.

Patch 1 fixes cgroup switching rcu issues related to the fact that perf_cgroup_sched_out() and perf_cgroup_sched_in() were missing some rcu read lock to protect the reference to the cgroup. Consequently, we moved the rcu readlock out of perf_cgroup_switch() to avoid double calls.

Patch 2 reinforces the testing for the rcu locking in perf cgorup code. Either we have to hold the rcu read lock or we must have the ctx->lock which guarantees the task cannot leave the cgroup.

Thanks to Peter and Eric from their suggestions on how to fix this correctly.

Stephane Eranian (2):
perf/core: fix RCU problem with cgroup context switching code perf/core: robustify perf_cgroup_from_task rcu checks

 arch/x86/kernel/cpu/perf_event_intel_cqm.c |  2 +-
 include/linux/perf_event.h                 |  6 ++++--
 kernel/events/core.c                       | 31 ++++++++++++++++++++----------
 3 files changed, 26 insertions(+), 13 deletions(-)
Signature · 1 line
2.5.0