]> www.infradead.org Git - users/jedix/linux-maple.git/commit
perf: Fix confusing aux iteration
authorFrederic Weisbecker <frederic@kernel.org>
Thu, 24 Apr 2025 16:11:28 +0000 (18:11 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Thu, 8 May 2025 19:50:19 +0000 (21:50 +0200)
commit881097c0549f3818f5aa31af8ccb49213bd99bed
tree1c5473c4cf37e409223620e6916a1643fe9f9103
parentf400565faa50737ac1d550d2c75128c0dad75765
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
kernel/events/core.c