]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ring-buffer: Check pending waiters when doing wake ups as well
authorSteven Rostedt (Google) <rostedt@goodmis.org>
Tue, 27 Sep 2022 23:15:25 +0000 (19:15 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 11:15:38 +0000 (13:15 +0200)
commit13b5e513c9cbbe835e3b2a99f65c1cd78570d995
treecc4446abee16d4dad7bf447c8e35db12284606d4
parent4548d9f5f9d9816c55422d5c9e7d2eed40668c5f
ring-buffer: Check pending waiters when doing wake ups as well

commit ec0bbc5ec5664dcee344f79373852117dc672c86 upstream.

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/20220927231824.209460321@goodmis.org
Cc: stable@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Fixes: 15693458c4bc0 ("tracing/ring-buffer: Move poll wake ups into ring buffer code")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/trace/ring_buffer.c