Re: [PATCH v2] rust: page: add byte-wise atomic memory copy methods
From: Peter Zijlstra
Date: Fri Feb 13 2026 - 04:56:36 EST
On Thu, Feb 12, 2026 at 03:51:24PM +0100, Andreas Hindborg wrote:
> When copying data from buffers that are mapped to user space, it is
> impossible to guarantee absence of concurrent memory operations on those
> buffers. Copying data to/from `Page` from/to these buffers would be
> undefined behavior if no special considerations are made.
>
> Add methods on `Page` to read and write the contents using byte-wise atomic
> operations.
I'm completely failing to understand. What!?
There is no such thing as an 'atomic' byte load, nor does it help one
whit against concurrent modification of the memory you're copying.