Re: [PATCH v3] rust: page: add byte-wise atomic memory copy methods
From: Peter Zijlstra
Date: Wed Feb 18 2026 - 05:34:05 EST
On Tue, Feb 17, 2026 at 11:10:15PM +0000, Gary Guo wrote:
> If we have this in stable, I think it's sufficient for LKMM. However
> for Rust/C11 MM says that volatile ops are not atomic and use them for
> concurrency is UB.
>
> I recall in last Rust all hands the vibe at discussion is that it's
> desirable to define volatile as being byte-wise atomic, so if that
> actually happens, this would indeed be what we want (but I think
> semantics w.r.t. mixed-size atomics need to be figured out first).
I would strongly suggest for volatile to be single-copy 'atomic' for any
naturally aligned word sized access. This is what we have with
GCC/Clang.
If you pick anything else, you're explicitly creation interoperability
issues.