Skip to content

Commit 3b19d61

Browse files
committed
ring-buffer: Have the shortest_full queue be the shortest not longest
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/[email protected] Cc: [email protected] Cc: Ingo Molnar <[email protected]> Cc: Andrew Morton <[email protected]> Fixes: 2c2b0a7 ("ring-buffer: Add percentage of ring buffer full to wake up reader") Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent fa8f4a8 commit 3b19d61

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/trace/ring_buffer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1011,7 +1011,7 @@ int ring_buffer_wait(struct trace_buffer *buffer, int cpu, int full)
10111011
nr_pages = cpu_buffer->nr_pages;
10121012
dirty = ring_buffer_nr_dirty_pages(buffer, cpu);
10131013
if (!cpu_buffer->shortest_full ||
1014-
cpu_buffer->shortest_full < full)
1014+
cpu_buffer->shortest_full > full)
10151015
cpu_buffer->shortest_full = full;
10161016
raw_spin_unlock_irqrestore(&cpu_buffer->reader_lock, flags);
10171017
if (!pagebusy &&

0 commit comments

Comments
 (0)