diff options
| author | Taeyang Lee <0wn@theori.io> | 2026-06-14 23:22:18 +0900 |
|---|---|---|
| committer | Peter Zijlstra <peterz@infradead.org> | 2026-07-02 13:21:48 +0200 |
| commit | 037a3c43edfb597665dd34457cd22b14692f2ba3 (patch) | |
| tree | 4b16db771e0d0b2447d031fba360db123c88f991 /drivers/gpu | |
| parent | dc59e4fea9d83f03bad6bddf3fa2e52491777482 (diff) | |
perf/core: Detach event groups during remove_on_exec
perf_event_remove_on_exec() removes events by calling
perf_event_exit_event(). For top-level events, this removes the event from
the context with DETACH_EXIT only.
This can leave inconsistent group state when a removed event is a group
leader and the group contains siblings without remove_on_exec. If the group
was active, the surviving siblings can remain active and attached to the
removed leader's sibling list, but are no longer represented by a valid
group leader on the PMU context active lists.
A later close of the removed leader uses DETACH_GROUP and can promote the
still-active siblings from this stale group state. The next schedule-in can
then add an already-linked active_list entry again, corrupting the PMU
context active list.
With DEBUG_LIST enabled, this is caught as a list_add double-add in
merge_sched_in().
Fix this by detaching group relationships when remove_on_exec removes an
event. This preserves the existing task-exit and revoke behavior, while
ensuring surviving siblings are ungrouped before the removed event leaves
the context.
Fixes: 2e498d0a74e5 ("perf: Add support for event removal on exec")
Signed-off-by: Taeyang Lee <0wn@theori.io>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/ai65GgZcC0LAlWLG@Taeyangs-MacBook-Pro.local
Diffstat (limited to 'drivers/gpu')
0 files changed, 0 insertions, 0 deletions
