perf: Fix the POLL_HUP delivery breakage
authorKan Liang <kan.liang@linux.intel.com>
Mon, 11 Aug 2025 18:26:44 +0000 (11:26 -0700)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 3 Sep 2025 08:10:59 +0000 (10:10 +0200)
commit18dbcbfabfffc4a5d3ea10290c5ad27f22b0d240
tree5f1ffc59d8e5b90a9dd54520cbb3d9ea45ea6437
parentb320789d6883cc00ac78ce83bccbfe7ed58afcf0
perf: Fix the POLL_HUP delivery breakage

The event_limit can be set by the PERF_EVENT_IOC_REFRESH to limit the
number of events. When the event_limit reaches 0, the POLL_HUP signal
should be sent. But it's missed.

The corresponding counter should be stopped when the event_limit reaches
0. It was implemented in the ARCH-specific code. However, since the
commit 9734e25fbf5a ("perf: Fix the throttle logic for a group"), all
the ARCH-specific code has been moved to the generic code. The code to
handle the event_limit was lost.

Add the event->pmu->stop(event, 0); back.

Fixes: 9734e25fbf5a ("perf: Fix the throttle logic for a group")
Closes: https://lore.kernel.org/lkml/aICYAqM5EQUlTqtX@li-2b55cdcc-350b-11b2-a85c-a78bff51fc11.ibm.com/
Reported-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Link: https://lkml.kernel.org/r/20250811182644.1305952-1-kan.liang@linux.intel.com
kernel/events/core.c