This reverts commit 18dbcbfabfffc4a5d3ea10290c5ad27f22b0d240.

The original issue was reported in [1], it shared a test program with
SIGIO. Since SIGIO is a standard signal, multiple notifications can be
coalesced, so userspace may miss a signal even though the signal was
generated by the event core.

Using the Ftrace signal tracepoints on arm64 shows that POLL_HUP is
generated, but the corresponding delivery trace event ("signal_deliver")
may be absent when SIGIO is used. In contrast, the kselftest
refresh_signal demonstrates that POLL_HUP delivery is reliable when using
a real-time signal, and the test passes without the extra pmu->stop()
call introduced by commit 18dbcbfabfff.

When the refresh limit reaches zero, __perf_event_overflow() already
calls perf_event_disable_inatomic(), which schedules the event disable
through irq_work. Calling the PMU stop callback directly here is
redundant and unrelated to signal delivery.

Remove the extra stop callback.

[1] 
https://lore.kernel.org/lkml/[email protected]/

Signed-off-by: Leo Yan <[email protected]>
---
 kernel/events/core.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index 
7935d5663944ee1cbaf38cf8018c3347635e8d31..7d98a56cd91c47e6ac0e4f8ace1ab494ba2b0501
 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -10750,7 +10750,6 @@ static int __perf_event_overflow(struct perf_event 
*event,
                ret = 1;
                event->pending_kill = POLL_HUP;
                perf_event_disable_inatomic(event);
-               event->pmu->stop(event, 0);
        }
 
        if (event->attr.sigtrap) {

-- 
2.34.1


Reply via email to