diff options
author | James Clark | 2021-12-06 11:38:40 +0000 |
---|---|---|
committer | Peter Zijlstra | 2022-01-26 15:06:06 +0100 |
commit | 961c39121759ad09a89598ec4ccdd34ae0468a19 (patch) | |
tree | 60591a8c0c7847bb55e5a615ef4332820d7599a6 /kernel/umh.c | |
parent | 8c16dc047b5dd8f7b3bf4584fa75733ea0dde7dc (diff) |
perf: Always wake the parent event
When using per-process mode and event inheritance is set to true,
forked processes will create a new perf events via inherit_event() ->
perf_event_alloc(). But these events will not have ring buffers
assigned to them. Any call to wakeup will be dropped if it's called on
an event with no ring buffer assigned because that's the object that
holds the wakeup list.
If the child event is disabled due to a call to
perf_aux_output_begin() or perf_aux_output_end(), the wakeup is
dropped leaving userspace hanging forever on the poll.
Normally the event is explicitly re-enabled by userspace after it
wakes up to read the aux data, but in this case it does not get woken
up so the event remains disabled.
This can be reproduced when using Arm SPE and 'stress' which forks once
before running the workload. By looking at the list of aux buffers read,
it's apparent that they stop after the fork:
perf record -e arm_spe// -vvv -- stress -c 1
With this patch applied they continue to be printed. This behaviour
doesn't happen when using systemwide or per-cpu mode.
Reported-by: Ruben Ayrapetyan <Ruben.Ayrapetyan@arm.com>
Signed-off-by: James Clark <james.clark@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20211206113840.130802-2-james.clark@arm.com
Diffstat (limited to 'kernel/umh.c')
0 files changed, 0 insertions, 0 deletions