FAILED: patch "[PATCH] tracing/ring-buffer: Have polling block on watermark" failed to apply to 5.4-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 5.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
Possible dependencies:
42fb0a1e84ff ("tracing/ring-buffer: Have polling block on watermark") 7e9fbbb1b776 ("ring-buffer: Add ring_buffer_wake_waiters()") 13292494379f ("tracing: Make struct ring_buffer less ambiguous") 1c5eb4481e01 ("tracing: Rename trace_buffer to array_buffer") 2d6425af6116 ("tracing: Declare newly exported APIs in include/linux/trace.h")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 42fb0a1e84ff525ebe560e2baf9451ab69127e2b Mon Sep 17 00:00:00 2001
From: "Steven Rostedt (Google)" <[email protected]>
Date: Thu, 20 Oct 2022 23:14:27 -0400
Subject: [PATCH] tracing/ring-buffer: Have polling block on watermark
Currently the way polling works on the ring buffer is broken. It will return immediately if there's any data in the ring buffer whereas a read will block until the watermark (defined by the tracefs buffer_percent file) is hit.
That is, a select() or poll() will return as if there's data available, but then the following read will block. This is broken for the way select()s and poll()s are supposed to work.
Have the polling on the ring buffer also block the same way reads and splice does on the ring buffer.
include/linux/ring_buffer.h +1 -1
@@ -100,7 +100,7 @@ __ring_buffer_alloc(unsigned long size, unsigned flags, struct lock_class_key *kint ring_buffer_wait (struct trace_buffer *buffer,int cpu,int full);__poll_t ring_buffer_poll_wait (struct trace_buffer *buffer,int cpu, -struct file *filp,poll_table *poll_table); +struct file *filp,poll_table *poll_table,int full);void ring_buffer_wake_waiters (struct trace_buffer *buffer,int cpu);#define RING_BUFFER_ALL_CPUS -1
kernel/trace/ring_buffer.c +36 -19
118 lines not on this page · raw message
kernel/trace/trace.c +1 -1
@@ -6681,7 +6681,7 @@ trace_poll(struct trace_iterator *iter, struct file *filp, poll_table *poll_tablreturn EPOLLIN |EPOLLRDNORM ; else return ring_buffer_poll_wait(iter->array_buffer->buffer, iter->cpu_file, - filp, poll_table); + filp, poll_table, iter->tr->buffer_percent); } static __poll_t
Steven Rostedt
maintainerAfter working on this, I believe the real Fixes tag should have been
2c2b0a78b3739 ("ring-buffer: Add percentage of ring buffer full to wake up reader")
Which was added in 5.0, so this is the only release I'm backporting this to.
-- Steve
------------------ original commit in Linus's tree ------------------
From 42fb0a1e84ff525ebe560e2baf9451ab69127e2b Mon Sep 17 00:00:00 2001
From: "Steven Rostedt (Google)" <[email protected]>
Date: Thu, 20 Oct 2022 23:14:27 -0400
Subject: [PATCH] tracing/ring-buffer: Have polling block on watermark
Currently the way polling works on the ring buffer is broken. It will return immediately if there's any data in the ring buffer whereas a read will block until the watermark (defined by the tracefs buffer_percent file) is hit.
That is, a select() or poll() will return as if there's data available, but then the following read will block. This is broken for the way select()s and poll()s are supposed to work.
Have the polling on the ring buffer also block the same way reads and splice does on the ring buffer.
--- include/linux/ring_buffer.h | 2 - kernel/trace/ring_buffer.c | 54 ++++++++++++++++++++++++++++---------------- kernel/trace/trace.c | 2 - 3 files changed, 37 insertions(+), 21 deletions(-)
include/linux/ring_buffer.h +1 -1
@@ -99,7 +99,7 @@ __ring_buffer_alloc(unsigned long size,int ring_buffer_wait (struct ring_buffer *buffer,int cpu,int full);__poll_t ring_buffer_poll_wait (struct ring_buffer *buffer,int cpu, -struct file *filp,poll_table *poll_table); +struct file *filp,poll_table *poll_table,int full);#define RING_BUFFER_ALL_CPUS -1
kernel/trace/ring_buffer.c +35 -19
117 lines not on this page · raw message
kernel/trace/trace.c +1 -1
@@ -5993,7 +5993,7 @@ trace_poll(struct trace_iterator *iter,return EPOLLIN |EPOLLRDNORM ; else return ring_buffer_poll_wait(iter->trace_buffer->buffer, iter->cpu_file, - filp, poll_table); + filp, poll_table, iter->tr->buffer_percent); } static __poll_t
Greg KH
maintainerQuoted 6 lines · Steven Rostedt
After working on this, I believe the real Fixes tag should have been
2c2b0a78b3739("ring-buffer: Add percentage of ring buffer full to wake up reader")Which was added in 5.0, so this is the only release I'm backporting this to.
Thanks, now queued up.
greg k-h