]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
ring-buffer: Correct stale comments related to non-consuming readers
authorPetr Pavlu <petr.pavlu@suse.com>
Fri, 17 May 2024 13:40:07 +0000 (15:40 +0200)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Tue, 21 May 2024 23:03:35 +0000 (19:03 -0400)
commitea70a9628e93168bb5a07b35f7b9a162a65afe9e
tree7fb5a11b8de56fadf4b95b3392fd930ff3db1b45
parentfa3889d970da8f95bdd90fb5a07d521810be5678
ring-buffer: Correct stale comments related to non-consuming readers

Adjust the following code documentation:

* Kernel-doc comments for ring_buffer_read_prepare() and
  ring_buffer_read_finish() mention that recording to the ring buffer is
  disabled when the read is active. Remove mention of this restriction
  because it was already lifted in commit 1039221cc278 ("ring-buffer: Do
  not disable recording when there is an iterator").

* Function ring_buffer_read_finish() performs a self-check of the
  ring-buffer by locking cpu_buffer->reader_lock and then calling
  rb_check_pages(). The preceding comment explains that the lock is
  needed because rb_check_pages() clears the HEAD flag required by
  readers which might be running in parallel. Remove this explanation
  because commit 8843e06f67b1 ("ring-buffer: Handle race between
  rb_move_tail and rb_check_pages") simplified the function so it no
  longer resets the mentioned flag. Nonetheless, the lock is still
  needed because a reader swapping a page into the ring buffer can make
  the underlying doubly-linked list temporarily inconsistent.

This is a non-functional change.

Link: https://lore.kernel.org/linux-trace-kernel/20240517134008.24529-2-petr.pavlu@suse.com
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/ring_buffer.c