diff options
author | Peter Zijlstra <peterz@infradead.org> | 2024-10-25 10:21:41 +0200 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2025-04-08 20:55:48 +0200 |
commit | da916e96e2dedcb2d40de77a7def833d315b81a6 (patch) | |
tree | e5dac626e93b753a7a32b56f728e36c76def148a /scripts/lib/kdoc/kdoc_files.py | |
parent | 4da0600edae1cf15d12bebacc66d7237e2c33fc6 (diff) |
perf: Make perf_pmu_unregister() useable
Previously it was only safe to call perf_pmu_unregister() if there
were no active events of that pmu around -- which was impossible to
guarantee since it races all sorts against perf_init_event().
Rework the whole thing by:
- keeping track of all events for a given pmu
- 'hiding' the pmu from perf_init_event()
- waiting for the appropriate (s)rcu grace periods such that all
prior references to the PMU will be completed
- detaching all still existing events of that pmu (see first point)
and moving them to a new REVOKED state.
- actually freeing the pmu data.
Where notably the new REVOKED state must inhibit all event actions
from reaching code that wants to use event->pmu.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Ravi Bangoria <ravi.bangoria@amd.com>
Link: https://lkml.kernel.org/r/20250307193723.525402029@infradead.org
Diffstat (limited to 'scripts/lib/kdoc/kdoc_files.py')
0 files changed, 0 insertions, 0 deletions