perf/ring_buffer: Add EPOLLRDNORM flag for poll
PATCH 1/1 perf/ring_buffer: Add EPOLLRDNORM flag for poll
The poll man page says POLLRDNORM is equivalent to POLLIN, so add EPOLLRDNORM here.
--- 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 ;
Signature · 1 line
2.43.0
Quoted 13 lines · Tao Chen
The poll man page says POLLRDNORM is equivalent to POLLIN, so add EPOLLRDNORM here.
Signed-off-by Tao Chen <[email protected]>--- kernel/events/ring_buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)kernel/events/ring_buffer.c +0
-0
kernel/events/ring_buffer.c line 22
Quoted 5 lines
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 );
So what does EPOLLRDNORM mean to begin with? There doesn't seem to be separate/specific handling of it anywhere in the kernel that I can see...
Thanks,
Ingo
Quoted 17 lines · Ingo Molnar
Quoted 14 lines · Tao Chen
The poll man page says POLLRDNORM is equivalent to POLLIN, so add EPOLLRDNORM here.
Signed-off-by Tao Chen <[email protected]>--- kernel/events/ring_buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)kernel/events/ring_buffer.c +0
-0@@ -19,7 +19,7 @@
Quoted 9 lines
kernel/events/ring_buffer.c line 22
Quoted 4 lines
kernel/events/ring_buffer.c +1
-1static void perf_output_wakeup (struct perf_output_handle *handle) { -atomic_set (&handle->rb->poll,EPOLLIN ); +atomic_set (&handle->rb->poll,EPOLLIN |EPOLLRDNORM );So what does EPOLLRDNORM mean to begin with? There doesn't seem to be separate/specific handling of it anywhere in the kernel that I can see...
It seems that if user set pollfd with POLLRDNORM, perf_poll will not return until timeout even if perf_output_wakeup called, whereas POLLIN returns.
Quoted 3 lines
Thanks,
Ingo
Signature · 2 lines
Best Regards Tao Chen
Quoted 27 lines · Tao Chen
Quoted 11 lines · Ingo Molnar
Quoted 8 lines · Tao Chen
The poll man page says POLLRDNORM is equivalent to POLLIN, so add EPOLLRDNORM here.
Signed-off-by Tao Chen <[email protected]>--- kernel/events/ring_buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Quoted 14 lines
kernel/events/ring_buffer.c line 21
Quoted 9 lines
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 );So what does EPOLLRDNORM mean to begin with? There doesn't seem to be separate/specific handling of it anywhere in the kernel that I can see...
Quoted 2 lines
It seems that if user set pollfd with POLLRDNORM,
perf_pollwill not return until timeout even ifperf_output_wakeupcalled, whereas POLLIN returns.
Mind adding this to the changelog, and explain that this patch fixes this particular poll() functionality and semantics for userspace?
Thanks,
Ingo
Quoted 2 lines · Ingo Molnar
explain that this patch fixes
this particularpoll()functionality and semantics
will do it, thanks.
Signature · 2 lines
Best Regards Tao Chen
Namhyung Kim
maintainerHello,
Quoted 30 lines · Ingo Molnar
Quoted 27 lines · Tao Chen
Quoted 25 lines · Ingo Molnar
Quoted 13 lines · Tao Chen
The poll man page says POLLRDNORM is equivalent to POLLIN, so add EPOLLRDNORM here.
Signed-off-by Tao Chen <[email protected]>--- kernel/events/ring_buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)kernel/events/ring_buffer.c +0
-0kernel/events/ring_buffer.c line 21
Quoted 4 lines
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 );So what does EPOLLRDNORM mean to begin with? There doesn't seem to be separate/specific handling of it anywhere in the kernel that I can see...
Quoted 5 lines
Quoted 2 lines
It seems that if user set pollfd with POLLRDNORM,
perf_pollwill not return until timeout even ifperf_output_wakeupcalled, whereas POLLIN returns.Mind adding this to the changelog, and explain that this patch fixes this particular
poll()functionality and semantics for userspace?
Off topic, but I think it should return something (either POLLHUP or POLLERR) when the event goes to an error state like pinned events are not scheduled.
Thanks,
Namhyung
Quoted 36 lines · Namhyung Kim
Hello,
Quoted 33 lines · Ingo Molnar
Quoted 29 lines · Tao Chen
Quoted 11 lines · Ingo Molnar
Quoted 8 lines · Tao Chen
The poll man page says POLLRDNORM is equivalent to POLLIN, so add EPOLLRDNORM here.
Signed-off-by Tao Chen <[email protected]>--- kernel/events/ring_buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Quoted 14 lines
kernel/events/ring_buffer.c line 21
Quoted 9 lines
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 );So what does EPOLLRDNORM mean to begin with? There doesn't seem to be separate/specific handling of it anywhere in the kernel that I can see...
It seems that if user set pollfd with POLLRDNORM,
perf_pollwill not return until timeout even ifperf_output_wakeupcalled, whereas POLLIN returns.
Quoted 6 lines
Quoted 2 lines
Mind adding this to the changelog, and explain that this patch fixes this particular
poll()functionality and semantics for userspace?Off topic, but I think it should return something (either POLLHUP or POLLERR) when the event goes to an error state like pinned events are not scheduled.
Mind sending a patch for that?
Thanks,
Ingo