]> git.ipfire.org Git - thirdparty/linux.git/commit
perf: Split __perf_pending_irq() out of perf_pending_irq()
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Thu, 4 Jul 2024 17:03:41 +0000 (19:03 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Tue, 9 Jul 2024 11:26:37 +0000 (13:26 +0200)
commit2b84def990d388bed4afe4f21ae383a01991046c
tree91218c98aa370156832d528b67700c4636f1ee6b
parent16b9569df9d2ab07eeee075cb7895e9d3e08e8f0
perf: Split __perf_pending_irq() out of perf_pending_irq()

perf_pending_irq() invokes perf_event_wakeup() and __perf_pending_irq().
The former is in charge of waking any tasks which waits to be woken up
while the latter disables perf-events.

The irq_work perf_pending_irq(), while this an irq_work, the callback
is invoked in thread context on PREEMPT_RT. This is needed because all
the waking functions (wake_up_all(), kill_fasync()) acquire sleep locks
which must not be used with disabled interrupts.
Disabling events, as done by __perf_pending_irq(), expects a hardirq
context and disabled interrupts. This requirement is not fulfilled on
PREEMPT_RT.

Split functionality based on perf_event::pending_disable into irq_work
named `pending_disable_irq' and invoke it in hardirq context on
PREEMPT_RT. Rename the split out callback to perf_pending_disable().

Reported-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Marco Elver <elver@google.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Link: https://lore.kernel.org/r/20240704170424.1466941-8-bigeasy@linutronix.de
include/linux/perf_event.h
kernel/events/core.c