Commit c5d93d2
perf: Enqueue SIGTRAP always via task_work.
A signal is delivered by raising irq_work() which works from any context
including NMI. irq_work() can be delayed if the architecture does not
provide an interrupt vector. In order not to lose a signal, the signal
is injected via task_work during event_sched_out().
Instead going via irq_work, the signal could be added directly via
task_work. The signal is sent to current and can be enqueued on its
return path to userland.
Queue signal via task_work and consider possible NMI context. Remove
perf_event::pending_sigtrap and and use perf_event::pending_work
instead.
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-4-bigeasy@linutronix.de1 parent 466e4d8 commit c5d93d2
2 files changed
+11
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
781 | 781 | | |
782 | 782 | | |
783 | 783 | | |
784 | | - | |
785 | 784 | | |
786 | 785 | | |
787 | 786 | | |
| |||
963 | 962 | | |
964 | 963 | | |
965 | 964 | | |
966 | | - | |
| 965 | + | |
967 | 966 | | |
968 | 967 | | |
969 | 968 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2283 | 2283 | | |
2284 | 2284 | | |
2285 | 2285 | | |
2286 | | - | |
2287 | | - | |
2288 | | - | |
2289 | | - | |
2290 | | - | |
2291 | | - | |
2292 | | - | |
2293 | | - | |
2294 | | - | |
2295 | | - | |
2296 | | - | |
2297 | 2286 | | |
2298 | 2287 | | |
2299 | 2288 | | |
| |||
6776 | 6765 | | |
6777 | 6766 | | |
6778 | 6767 | | |
6779 | | - | |
6780 | | - | |
6781 | | - | |
6782 | | - | |
6783 | | - | |
6784 | 6768 | | |
6785 | 6769 | | |
6786 | 6770 | | |
| |||
9721 | 9705 | | |
9722 | 9706 | | |
9723 | 9707 | | |
| 9708 | + | |
9724 | 9709 | | |
9725 | 9710 | | |
9726 | 9711 | | |
9727 | | - | |
9728 | | - | |
| 9712 | + | |
| 9713 | + | |
| 9714 | + | |
| 9715 | + | |
| 9716 | + | |
| 9717 | + | |
9729 | 9718 | | |
9730 | 9719 | | |
9731 | 9720 | | |
9732 | 9721 | | |
9733 | 9722 | | |
9734 | | - | |
| 9723 | + | |
9735 | 9724 | | |
9736 | 9725 | | |
9737 | 9726 | | |
9738 | | - | |
| 9727 | + | |
9739 | 9728 | | |
9740 | 9729 | | |
9741 | 9730 | | |
| |||
9745 | 9734 | | |
9746 | 9735 | | |
9747 | 9736 | | |
9748 | | - | |
| 9737 | + | |
9749 | 9738 | | |
9750 | 9739 | | |
9751 | 9740 | | |
| |||
0 commit comments