Skip to content

Commit

Permalink
perf/ring_buffer: Allow the EPOLLRDNORM flag for poll
Browse files Browse the repository at this point in the history
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.

Fixes: 7636913 ("perf: Split up buffer handling from core code")
Signed-off-by: Tao Chen <chen.dylane@linux.dev>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/20250314030036.2543180-1-chen.dylane@linux.dev
  • Loading branch information
Tao Chen authored and Ingo Molnar committed Mar 17, 2025
1 parent f4b07fd commit c96fff3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/events/ring_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit c96fff3

Please sign in to comment.