Re: [PATCH v3] rust: page: add byte-wise atomic memory copy methods
From: Peter Zijlstra
Date: Fri Feb 13 2026 - 06:29:03 EST
On Fri, Feb 13, 2026 at 07:42:53AM +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.
>
> Also improve clarity by specifying additional requirements on
> `read_raw`/`write_raw` methods regarding concurrent operations on involved
> buffers.
> + /// - Callers must ensure that this call does not race with a write to the source page that
> + /// overlaps with this read.
Yeah, but per the bit above, its user mapped, you *CANNOT* ensure this.
And same comment as for v2, none of this makes sense. Byte loads are not
magically atomic. And they don't actually fix anything.
NAK