Skip to content

Commit ec0bbc5

Browse files
committed
ring-buffer: Check pending waiters when doing wake ups as well
The wake up waiters only checks the "wakeup_full" variable and not the "full_waiters_pending". The full_waiters_pending is set when a waiter is added to the wait queue. The wakeup_full is only set when an event is triggered, and it clears the full_waiters_pending to avoid multiple calls to irq_work_queue(). The irq_work callback really needs to check both wakeup_full as well as full_waiters_pending such that this code can be used to wake up waiters when a file is closed that represents the ring buffer and the waiters need to be woken up. Link: https://lkml.kernel.org/r/[email protected] Cc: [email protected] Cc: Ingo Molnar <[email protected]> Cc: Andrew Morton <[email protected]> Fixes: 1569345 ("tracing/ring-buffer: Move poll wake ups into ring buffer code") Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent 3b19d61 commit ec0bbc5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kernel/trace/ring_buffer.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -917,8 +917,9 @@ static void rb_wake_up_waiters(struct irq_work *work)
917917
struct rb_irq_work *rbwork = container_of(work, struct rb_irq_work, work);
918918

919919
wake_up_all(&rbwork->waiters);
920-
if (rbwork->wakeup_full) {
920+
if (rbwork->full_waiters_pending || rbwork->wakeup_full) {
921921
rbwork->wakeup_full = false;
922+
rbwork->full_waiters_pending = false;
922923
wake_up_all(&rbwork->full_waiters);
923924
}
924925
}

0 commit comments

Comments
 (0)