Linux Perf Users
 help / color / mirror / Atom feed
* [PATCH v2 0/2] perf: Improve refresh limit in overflow handler
@ 2026-05-14 16:21 Leo Yan
  2026-05-14 16:21 ` [PATCH v2 1/2] selftests/perf_events: Add test for refresh limit signals Leo Yan
  2026-05-14 16:21 ` [PATCH v2 2/2] perf/core: Ignore overflows while disable is pending Leo Yan
  0 siblings, 2 replies; 5+ messages in thread
From: Leo Yan @ 2026-05-14 16:21 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Shuah Khan, Arnaldo Carvalho de Melo,
	Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Ian Rogers, Adrian Hunter, James Clark, Sumanth Korikkar
  Cc: linux-kernel, linux-kselftest, linux-perf-users, Leo Yan

Commit 18dbcbfabfff ("perf: Fix the POLL_HUP delivery breakage") added a
direct pmu->stop() call when the refresh limit reaches zero. The change
was based on a test program [1] that reported missing POLL_HUP
notifications.

However, the test program used SIGIO, which is a standard signal and can
be coalesced. As a result, userspace may miss signal delivery even
though the signal was generated by the kernel. This is expected
behaviour for standard signals.

This series adds a selftest for the PERF_EVENT_IOC_REFRESH limit using a
real-time signal, which guarantees queued signal delivery and confirms
that POLL_HUP notifications are delivered reliably on arm64.

The second patch replaces the direct PMU stop with an explicit
pending-disable guard, this can avoid redundant stop for most cases and
logic is easier to understand.

[1] https://lore.kernel.org/lkml/aICYAqM5EQUlTqtX@li-2b55cdcc-350b-11b2-a85c-a78bff51fc11.ibm.com/

Signed-off-by: Leo Yan <leo.yan@arm.com>
---
Changes in v2:
- Replaced ASSERT_EQ() with EXPECT_EQ() in test tear down (Sashiko).
- Handled a race case for high frequency overflow before disable irq_work (Sashiko).
- Link to v1: https://lore.kernel.org/r/20260512-arm_cs_clean_perf_handle-v1-0-75ff373ecd22@arm.com

---
Leo Yan (2):
      selftests/perf_events: Add test for refresh limit signals
      perf/core: Ignore overflows while disable is pending

 kernel/events/core.c                               |   8 +-
 tools/testing/selftests/perf_events/.gitignore     |   1 +
 tools/testing/selftests/perf_events/Makefile       |   3 +-
 .../testing/selftests/perf_events/refresh_signal.c | 120 +++++++++++++++++++++
 4 files changed, 130 insertions(+), 2 deletions(-)
---
base-commit: e1914add2799225a87502051415fc5c32aeb02ae
change-id: 20260429-arm_cs_clean_perf_handle-763cc339c1f5

Best regards,
-- 
Leo Yan <leo.yan@arm.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-05-14 21:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-14 16:21 [PATCH v2 0/2] perf: Improve refresh limit in overflow handler Leo Yan
2026-05-14 16:21 ` [PATCH v2 1/2] selftests/perf_events: Add test for refresh limit signals Leo Yan
2026-05-14 20:06   ` sashiko-bot
2026-05-14 16:21 ` [PATCH v2 2/2] perf/core: Ignore overflows while disable is pending Leo Yan
2026-05-14 21:36   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox