Skip to content

tracing: Fix remote reader page swap failures

Ivan Immanuel Shaji b4-sent linux-trace-kernel lkml stable 2 versions New

Get series with b4
b4 am [email protected] change-id 20260825-kernel-patch-1-d806e3de01a5

Versions newest first

  1. v2 Latest2 patches 0 repliesNew
  2. v12 patches 2 repliesSuperseded

Changes in v2 from the cover letter

- Report callback failures with pr_warn_ratelimited() instead of WARN_ON_ONCE(), as suggested by Vincent Donnefort.
- Add Vincent Donnefort's Reviewed-by tag to patch 1.
- Link to v1: https://lore.kernel.org/r/[email protected]

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2tracing: Fix retry exhaustion in simple ring buffer reader swapkernel/trace/simple_ring_buffer.c+2 -20 replies
2/2ring-buffer: Stop remote reader update when page swap failskernel/trace/ring_buffer.c+5 -20 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchVincent Donnefort
1/2R-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/2] tracing: Fix remote reader page swap failures

The simple ring buffer's reader-page swap retry loop mishandles its last attempt. A success at that point is reported as an error, while a failure is allowed to continue into the pointer updates. The remote ring buffer consumer compounds callback failures by warning and continuing with stale reader metadata.

Fix the retry result in the provider, then stop the remote consumer before it mutates its local page list when the swap fails.

These paths are used by remote tracing, including arm64 nVHE EL2 tracing and CONFIG_TRACE_REMOTE_TEST.

Testing:

  make C=2 W=1 kernel/trace/simple_ring_buffer.o kernel/trace/ring_buffer.o
  scripts/checkpatch.pl --no-tree (each formatted patch)

No runtime reproducer was run. The two final-attempt outcomes follow from the retry counter's post-decrement semantics. An arm64 cross-compiler was not available.

---
Changes in v2:
- Report callback failures with pr_warn_ratelimited() instead of WARN_ON_ONCE(), as suggested by Vincent Donnefort.
- Add Vincent Donnefort's Reviewed-by tag to patch 1.
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Ivan Immanuel Shaji (2):
tracing: Fix retry exhaustion in simple ring buffer reader swap
ring-buffer: Stop remote reader update when page swap fails

 kernel/trace/ring_buffer.c        | 7 +++++--
 kernel/trace/simple_ring_buffer.c | 4 ++--
 2 files changed, 7 insertions(+), 4 deletions(-)

---
base-commit: 66498c75b4f8017f62d720d9b59675bdf3abce91
change-id: 20260825-kernel-patch-1-d806e3de01a5

Best regards,

Signature · 1 line
Ivan Immanuel Shaji <[email protected]>