* [PATCH linux-next v2] perf/ring_buffer: Add EPOLLRDNORM flag for poll
@ 2025-03-14 3:00 Tao Chen
2025-03-17 7:47 ` [tip: perf/core] perf/ring_buffer: Allow the " tip-bot2 for Tao Chen
0 siblings, 1 reply; 2+ messages in thread
From: Tao Chen @ 2025-03-14 3:00 UTC (permalink / raw)
To: peterz, mingo, acme, namhyung, mark.rutland, alexander.shishkin,
jolsa, irogers, adrian.hunter, kan.liang, fweisbec
Cc: linux-perf-users, linux-kernel, Tao Chen
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>
---
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/20250313051047.2436098-1-chen.dylane@linux.dev
diff --git a/kernel/events/ring_buffer.c b/kernel/events/ring_buffer.c
index 59a52b1a1..5130b119d 100644
--- a/kernel/events/ring_buffer.c
+++ b/kernel/events/ring_buffer.c
@@ -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;
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [tip: perf/core] perf/ring_buffer: Allow the EPOLLRDNORM flag for poll
2025-03-14 3:00 [PATCH linux-next v2] perf/ring_buffer: Add EPOLLRDNORM flag for poll Tao Chen
@ 2025-03-17 7:47 ` tip-bot2 for Tao Chen
0 siblings, 0 replies; 2+ messages in thread
From: tip-bot2 for Tao Chen @ 2025-03-17 7:47 UTC (permalink / raw)
To: linux-tip-commits
Cc: Tao Chen, Ingo Molnar, Peter Zijlstra, Arnaldo Carvalho de Melo,
H. Peter Anvin, Linus Torvalds, x86, linux-kernel
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 <chen.dylane@linux.dev>
AuthorDate: Fri, 14 Mar 2025 11:00:36 +08:00
Committer: Ingo Molnar <mingo@kernel.org>
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.
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 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/events/ring_buffer.c b/kernel/events/ring_buffer.c
index 59a52b1..5130b11 100644
--- a/kernel/events/ring_buffer.c
+++ b/kernel/events/ring_buffer.c
@@ -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;
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-03-17 7:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-14 3:00 [PATCH linux-next v2] perf/ring_buffer: Add EPOLLRDNORM flag for poll Tao Chen
2025-03-17 7:47 ` [tip: perf/core] perf/ring_buffer: Allow the " tip-bot2 for Tao Chen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.