]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ring-buffer: Update pages_touched to reflect persistent buffer content
authorSteven Rostedt <rostedt@goodmis.org>
Fri, 14 Feb 2025 17:35:12 +0000 (12:35 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Feb 2025 13:01:29 +0000 (14:01 +0100)
commit9f837ea9221c868ff6db5ba8ea1f26b80b490b02
tree87e31105f19461ef3f464e912ade521544938e4d
parent3ec743d558f111d8999aea24577ba66c65ee2eeb
ring-buffer: Update pages_touched to reflect persistent buffer content

commit 97937834ae876f29565415ab15f1284666dc6be3 upstream.

The pages_touched field represents the number of subbuffers in the ring
buffer that have content that can be read. This is used in accounting of
"dirty_pages" and "buffer_percent" to allow the user to wait for the
buffer to be filled to a certain amount before it reads the buffer in
blocking mode.

The persistent buffer never updated this value so it was set to zero, and
this accounting would take it as it had no content. This would cause user
space to wait for content even though there's enough content in the ring
buffer that satisfies the buffer_percent.

Cc: stable@vger.kernel.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Vincent Donnefort <vdonnefort@google.com>
Link: https://lore.kernel.org/20250214123512.0631436e@gandalf.local.home
Fixes: 5f3b6e839f3ce ("ring-buffer: Validate boot range memory events")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/trace/ring_buffer.c