]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
perf/ring_buffer: Allow the EPOLLRDNORM flag for poll
authorTao Chen <chen.dylane@linux.dev>
Fri, 14 Mar 2025 03:00:36 +0000 (11:00 +0800)
committerIngo Molnar <mingo@kernel.org>
Mon, 17 Mar 2025 07:31:04 +0000 (08:31 +0100)
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: 76369139ceb9 ("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
kernel/events/ring_buffer.c

index 59a52b1a1f7899d41e629bd06b8ddfba1f9868e7..5130b119d0ae04f1ba73b30d54a4342c5dbc9c98 100644 (file)
@@ -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;