Skip to content

tracing/ring-buffer: Some fixes to ring buffer readers

Steven Rostedt lkml stable 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3ring-buffer: Fix waking up ring buffer readerskernel/trace/ring_buffer.c+68 -710 replies
2/3ring-buffer: Fix resetting of shortest_fullkernel/trace/ring_buffer.c+23 -70 replies
3/3tracing: Use .flush() call to wake up readerskernel/trace/trace.c+15 -60 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [for-linus][PATCH 0/3] tracing/ring-buffer: Some fixes to ring buffer readers

Three fixes to the ring buffer wake ups:

1) ring_buffer_wait() should not loop.
The ring_buffer_wait() does not have the full context (yet) on if it should loop or not. Just exit the loop as soon as its woken up and let the callers decide to loop or not (they already do, so it's a bit redundant).

2) Fix shortest_full field to be the smallest amount in the ring buffer that a waiter is waiting for. The "shortest_full" field is updated when a new waiter comes in and wants to wait for a smaller amount of data in the ring buffer than other waiters. But after all waiters are woken up, it's not reset, so if another waiter comes in wanting to wait for more data, it will be woken up when the ring buffer has a smaller amount from what the previous waiters were waiting for.

3) The wake up all waiters on close is incorrectly called frome .release() and not from .flush() so it will never wake up any waiters as the .release() will not get called until all .read() calls are finished. And the wakeup is for the waiters in those .read() calls.

Steven Rostedt (Google) (3):
ring-buffer: Fix waking up ring buffer readers
ring-buffer: Fix resetting of shortest_full
tracing: Use .flush() call to wake up readers

----

 kernel/trace/ring_buffer.c | 169 ++++++++++++++++++++++++---------------------
 kernel/trace/trace.c       |  21 ++++--
 2 files changed, 106 insertions(+), 84 deletions(-)