aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorFrederic Weisbecker <frederic@kernel.org>2025-04-24 18:11:28 +0200
committerPeter Zijlstra <peterz@infradead.org>2025-05-08 21:50:19 +0200
commit881097c0549f3818f5aa31af8ccb49213bd99bed (patch)
tree1c5473c4cf37e409223620e6916a1643fe9f9103
parentperf: Remove too early and redundant CPU hotplug handling (diff)
downloadwireguard-linux-881097c0549f3818f5aa31af8ccb49213bd99bed.tar.xz
wireguard-linux-881097c0549f3818f5aa31af8ccb49213bd99bed.zip
perf: Fix confusing aux iteration
While an event tears down all links to it as an aux, the iteration happens on the event's group leader instead of the group itself. If the event is a group leader, it has no effect because the event is also its own group leader. But otherwise there would be a risk to detach all the siblings events from the wrong group leader. It just happens to work because each sibling's aux link is tested against the right event before proceeding. Also the ctx lock is the same for the events and their group leader so the iteration is safe. Yet the iteration is confusing. Clarify the actual intent. Signed-off-by: Frederic Weisbecker <frederic@kernel.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/20250424161128.29176-5-frederic@kernel.org
-rw-r--r--kernel/events/core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c
index e0ca4a88beb5..b8461074600b 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -2171,7 +2171,7 @@ static void perf_put_aux_event(struct perf_event *event)
* If the event is an aux_event, tear down all links to
* it from other events.
*/
- for_each_sibling_event(iter, event->group_leader) {
+ for_each_sibling_event(iter, event) {
if (iter->aux_event != event)
continue;