Re: [PATCH] ring-buffer: Mark concurrent accesses to waiter flags

From: Steven Rostedt

Date: Thu Nov 12 2026 - 05:53:13 EST


On Wed, 11 Nov 2026 16:41:37 +0800
Zhu Jun <zhujun2@xxxxxxxxxxxxxxxxxxxx> wrote:

> Poll and wait paths set the pending waiter flags while ring buffer
> writers test and clear them without a common lock. The irq_work callback
> also accesses the full-buffer wakeup flags concurrently. These plain
> accesses cause KCSAN reports.
>
> Use READ_ONCE() and WRITE_ONCE() for the shared waiter and wakeup flags.
> Keep the existing barriers and irq_work wakeup protocol unchanged.
>
> Fixes: 15693458c4bc ("tracing/ring-buffer: Move poll wake ups into ring buffer code")
> Fixes: 1e0d6714aceb ("ring-buffer: Do not wake up a splice waiter when page is not full")
> Signed-off-by: Zhu Jun <zhujun2@xxxxxxxxxxxxxxxxxxxx>

Is this simply to prevent read/write tearing?

-- Steve