]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ring-buffer: Do not set shortest_full when full target is hit
authorSteven Rostedt (Google) <rostedt@goodmis.org>
Tue, 12 Mar 2024 15:56:41 +0000 (11:56 -0400)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Tue, 12 Mar 2024 16:40:28 +0000 (12:40 -0400)
commit761d9473e27f0c8782895013a3e7b52a37c8bcfc
tree0934ad36d5bda7205c74cf0016a74e50eb14c163
parente5d7c1916562f0e856eb3d6f569629fcd535fed2
ring-buffer: Do not set shortest_full when full target is hit

The rb_watermark_hit() checks if the amount of data in the ring buffer is
above the percentage level passed in by the "full" variable. If it is, it
returns true.

But it also sets the "shortest_full" field of the cpu_buffer that informs
writers that it needs to call the irq_work if the amount of data on the
ring buffer is above the requested amount.

The rb_watermark_hit() always sets the shortest_full even if the amount in
the ring buffer is what it wants. As it is not going to wait, because it
has what it wants, there's no reason to set shortest_full.

Link: https://lore.kernel.org/linux-trace-kernel/20240312115641.6aa8ba08@gandalf.local.home
Cc: stable@vger.kernel.org
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fixes: 42fb0a1e84ff5 ("tracing/ring-buffer: Have polling block on watermark")
Reviewed-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/ring_buffer.c