ring-buffer: Stop remote reader update when page swap fails
authorIvan Immanuel Shaji <ivanimmanuel1234@gmail.com>
Tue, 25 Aug 2026 16:52:50 +0000 (12:52 -0400)
committerSteven Rostedt <rostedt@goodmis.org>
Fri, 28 Aug 2026 01:31:51 +0000 (21:31 -0400)
commit5eab74874d11160725c42ab676ba97a797a362eb
tree9834233e5bde5c0587aaa2ee57eb75420b40eb12
parente0d3aed7b12cf37b74c7cc5265073d0263b49cde
ring-buffer: Stop remote reader update when page swap fails

The remote swap_reader_page callback can return -EBUSY when the writer
moves the head before the remote catches it, particularly during an event
storm on a small buffer. __rb_get_reader_page_from_remote() currently
warns about that failure but continues with the unchanged reader ID and
rearranges the local page list as though the swap succeeded.

Handle the callback failure as a recoverable error. Report it with
pr_warn_ratelimited() and return NULL. Callers already handle a NULL reader
page as a failed attempt. This avoids splicing the same page as both the
previous and new reader without flooding the log under contention.

Cc: stable@vger.kernel.org
Fixes: 2e67fabd8b77 ("ring-buffer: Introduce ring-buffer remotes")
Link: https://patch.msgid.link/20260825-kernel-patch-1-v2-2-bb3461807a32@gmail.com
Assisted-by: LLM sparse
Signed-off-by: Ivan Immanuel Shaji <ivanimmanuel1234@gmail.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/ring_buffer.c