This is a note to let you know that I've just added the patch titled ring-buffer: Have the shortest_full queue be the shortest not longest to the 5.19-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: ring-buffer-have-the-shortest_full-queue-be-the-shortest-not-longest.patch and it can be found in the queue-5.19 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 3b19d614b61b93a131f463817e08219c9ce1fee3 Mon Sep 17 00:00:00 2001 From: "Steven Rostedt (Google)" <rostedt@xxxxxxxxxxx> Date: Tue, 27 Sep 2022 19:15:24 -0400 Subject: ring-buffer: Have the shortest_full queue be the shortest not longest From: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx> commit 3b19d614b61b93a131f463817e08219c9ce1fee3 upstream. The logic to know when the shortest waiters on the ring buffer should be woken up or not has uses a less than instead of a greater than compare, which causes the shortest_full to actually be the longest. Link: https://lkml.kernel.org/r/20220927231823.718039222@xxxxxxxxxxx Cc: stable@xxxxxxxxxxxxxxx Cc: Ingo Molnar <mingo@xxxxxxxxxx> Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Fixes: 2c2b0a78b3739 ("ring-buffer: Add percentage of ring buffer full to wake up reader") Signed-off-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- kernel/trace/ring_buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c @@ -1011,7 +1011,7 @@ int ring_buffer_wait(struct trace_buffer nr_pages = cpu_buffer->nr_pages; dirty = ring_buffer_nr_dirty_pages(buffer, cpu); if (!cpu_buffer->shortest_full || - cpu_buffer->shortest_full < full) + cpu_buffer->shortest_full > full) cpu_buffer->shortest_full = full; raw_spin_unlock_irqrestore(&cpu_buffer->reader_lock, flags); if (!pagebusy && Patches currently in stable-queue which might be from rostedt@xxxxxxxxxxx are queue-5.19/tracing-fix-reading-strings-from-synthetic-events.patch queue-5.19/tracing-add-ioctl-to-force-ring-buffer-waiters-to-wake-up.patch queue-5.19/ring-buffer-have-the-shortest_full-queue-be-the-shortest-not-longest.patch queue-5.19/ring-buffer-add-ring_buffer_wake_waiters.patch queue-5.19/tracing-move-duplicate-code-of-trace_kprobe-eprobe.c-into-header.patch queue-5.19/tracing-add-fault-name-injection-to-kernel-probes.patch queue-5.19/ring-buffer-fix-race-between-reset-page-and-reading-page.patch queue-5.19/tracing-wake-up-ring-buffer-waiters-on-closing-of-the-file.patch queue-5.19/ftrace-still-disable-enabled-records-marked-as-disabled.patch queue-5.19/tracing-disable-interrupt-or-preemption-before-acquiring-arch_spinlock_t.patch queue-5.19/tracing-do-not-free-snapshot-if-tracer-is-on-cmdline.patch queue-5.19/tracing-wake-up-waiters-when-tracing-is-disabled.patch queue-5.19/ring-buffer-allow-splice-to-read-previous-partially-read-pages.patch queue-5.19/ring-buffer-check-pending-waiters-when-doing-wake-ups-as-well.patch queue-5.19/ftrace-properly-unset-ftrace_hash_fl_mod.patch