Files
linux-stable-mirror/include/linux
Peter ZijlstraandGreg Kroah-Hartman 94902ee299 perf: Rework perf_event_exit_event()
[ Upstream commit ef54c1a476 ]

Make perf_event_exit_event() more robust, such that we can use it from
other contexts. Specifically the up and coming remove_on_exec.

For this to work we need to address a few issues. Remove_on_exec will
not destroy the entire context, so we cannot rely on TASK_TOMBSTONE to
disable event_function_call() and we thus have to use
perf_remove_from_context().

When using perf_remove_from_context(), there's two races to consider.
The first is against close(), where we can have concurrent tear-down
of the event. The second is against child_list iteration, which should
not find a half baked event.

To address this, teach perf_remove_from_context() to special case
!ctx->is_active and about DETACH_CHILD.

[ elver@google.com: fix racing parent/child exit in sync_child_event(). ]
Signed-off-by: Marco Elver <elver@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20210408103605.1676875-2-elver@google.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-05-11 14:47:31 +02:00
..
2021-04-14 08:42:11 +02:00
2021-04-28 13:40:00 +02:00
2021-03-04 11:37:59 +01:00
2021-02-07 15:37:17 +01:00
2021-03-30 14:31:52 +02:00
2021-03-30 14:32:05 +02:00
2021-03-07 12:34:15 +01:00
2021-05-07 11:04:32 +02:00