Thread (31 messages) 31 messages, 6 authors, 10h ago

Re: [PATCH RFC 07/11] dyndbg: use READ_ONCE()/WRITE_ONCE() to access descriptor flags

flat view

From: "Gary Guo" <gary@garyguo.net>
Date: 2026-10-11 13:16:29
Also in: driver-core, linux-kselftest, lkml, rust-for-linux

On Sun Oct 11, 2026 at 1:52 PM BST, Thomas Weißschuh wrote:
The descriptor flags are accessed concurrently. Use
READ_ONCE()/WRITE_ONCE() to keep their contents consistent.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>

---
I am not entirely sure about this. We are only using single bits, so
torn reads/writes should not matter. But LKMM has no guidance on this as
far as I can see. Also for Rust this seems to be necessary.
Code should assume plain writes to be atomic. Concurrently accessed data should
use READ_ONCE/WRITE_ONCE so you're right on this one.

I think this patch should be merged with the bitfield definition change, though.

Best,
Gary
quoted hunk ↗ jump to hunk
---
 include/linux/dynamic_debug.h |  6 +++---
 lib/dynamic_debug.c           | 24 +++++++++++++-----------
 2 files changed, 16 insertions(+), 14 deletions(-)
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help