perf/ring_buffer: Add EPOLLRDNORM flag for poll
PATCH v2 1/1 perf/ring_buffer: Add EPOLLRDNORM flag for poll
The poll man page says POLLRDNORM is equivalent to POLLIN. For poll, it seems that if user sets pollfd with POLLRDNORM in userspace, perf_poll will not return until timeout even if perf_output_wakeup called, whereas POLLIN returns.
--- kernel/events/ring_buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Change list:
- v1 -> v2:
- add changelog
- v1
https://lore.kernel.org/all/[email protected]
kernel/events/ring_buffer.c +1 -1
@@ -19,7 +19,7 @@static void perf_output_wakeup (struct perf_output_handle *handle) { -atomic_set (&handle->rb->poll,EPOLLIN ); +atomic_set (&handle->rb->poll,EPOLLIN |EPOLLRDNORM ); handle->event->pending_wakeup =1 ;
Signature · 1 line
2.43.0
[tip: perf/core] perf/ring_buffer: Allow the EPOLLRDNORM flag for poll
The following commit has been merged into the perf/core branch of tip:
The following commit has been merged into the perf/core branch of tip:
Commit-ID: c96fff391c095c11dc87dab35be72dee7d217cde Gitweb: https://git.kernel.org/tip/c96fff391c095c11dc87dab35be72dee7d217cde Author: Tao Chen <[email protected]> AuthorDate: Fri, 14 Mar 2025 11:00:36 +08:00 Committer: Ingo Molnar <[email protected]> CommitterDate: Mon, 17 Mar 2025 08:31:04 +01:00
perf/ring_buffer: Allow the EPOLLRDNORM flag for poll
The poll man page says POLLRDNORM is equivalent to POLLIN. For poll(), it seems that if user sets pollfd with POLLRDNORM in userspace, perf_poll will not return until timeout even if perf_output_wakeup called, whereas POLLIN returns.
--- kernel/events/ring_buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/events/ring_buffer.c +1 -1
@@ -19,7 +19,7 @@static void perf_output_wakeup (struct perf_output_handle *handle) { -atomic_set (&handle->rb->poll,EPOLLIN ); +atomic_set (&handle->rb->poll,EPOLLIN |EPOLLRDNORM ); handle->event->pending_wakeup =1 ;