[PATCH v4 0/2] (no cover subject)

From: Andreas Hindborg

Date: Fri Jun 05 2026 - 06:47:40 EST


Signed-off-by: Andreas Hindborg <a.hindborg@xxxxxxxxxx>
---
Changes in v4:
- Split `atomic_per_byte_memcpy` out into its own patch (Boqun).
- Expand `atomic_per_byte_memcpy` documentation to explain the
concurrent-safe semantics and to note that the kernel's `memcpy()`
uses byte-wise atomic load/store instructions (Boqun).
- Clarify the src/dst asymmetry in the documentation of
`Page::{read,write}_bytewise_atomic` (Boqun).
- Use the "valid for atomic {reads,writes}" shorthand in the safety
lists of the new methods and of `atomic_per_byte_memcpy` (Benno).
- Drop the redundant data-race bullets that v3 added on
`Page::{read,write}_raw` (Miguel).
- Link to v3: https://msgid.link/20260213-page-volatile-io-v3-1-d60487b04d40@xxxxxxxxxx

Changes in v3:
- Update documentation adn safety requirements for `Page::{read,write}_bytewise_atomic`.
- Update safety comments in `Page::{read,write}_bytewise_atomic`.
- Call the correct copy function in `Page::{read,write}_bytewise_atomic`.
- Link to v2: https://msgid.link/20260212-page-volatile-io-v2-1-a36cb97d15c2@xxxxxxxxxx

Changes in v2:
- Rewrite patch with byte-wise atomic operations as foundation of operation.
- Update subject and commit message.
- Link to v1: https://lore.kernel.org/r/20260130-page-volatile-io-v1-1-19f3d3e8f265@xxxxxxxxxx

To: Will Deacon <will@xxxxxxxxxx>
To: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
To: Boqun Feng <boqun@xxxxxxxxxx>
To: Mark Rutland <mark.rutland@xxxxxxx>
To: Gary Guo <gary@xxxxxxxxxxx>
To: Miguel Ojeda <ojeda@xxxxxxxxxx>
To: Björn Roy Baron <bjorn3_gh@xxxxxxxxxxxxxx>
To: Benno Lossin <lossin@xxxxxxxxxx>
To: Andreas Hindborg <a.hindborg@xxxxxxxxxx>
To: Alice Ryhl <aliceryhl@xxxxxxxxxx>
To: Trevor Gross <tmgross@xxxxxxxxx>
To: Danilo Krummrich <dakr@xxxxxxxxxx>
To: Lorenzo Stoakes <ljs@xxxxxxxxxx>
To: "Liam R. Howlett" <liam@xxxxxxxxxxxxx>
Cc: linux-kernel@xxxxxxxxxxxxxxx
Cc: rust-for-linux@xxxxxxxxxxxxxxx
Cc: linux-mm@xxxxxxxxx

---
Andreas Hindborg (2):
rust: sync: atomic: add atomic_per_byte_memcpy
rust: page: add byte-wise atomic memory copy methods

rust/kernel/page.rs | 70 ++++++++++++++++++++++++++++++++++++++++++++++
rust/kernel/sync/atomic.rs | 35 +++++++++++++++++++++++
2 files changed, 105 insertions(+)
---
base-commit: 7fd2df204f342fc17d1a0bfcd474b24232fb0f32
change-id: 20260130-page-volatile-io-05ff595507d3

Best regards,
--
Andreas Hindborg <a.hindborg@xxxxxxxxxx>