linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v7 0/9] LKMM generic atomics in Rust
@ 2025-07-14  5:36 Boqun Feng
  2025-07-14  5:36 ` [PATCH v7 1/9] rust: Introduce atomic API helpers Boqun Feng
                   ` (8 more replies)
  0 siblings, 9 replies; 50+ messages in thread
From: Boqun Feng @ 2025-07-14  5:36 UTC (permalink / raw)
  To: linux-kernel, rust-for-linux, lkmm, linux-arch
  Cc: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, Danilo Krummrich, Will Deacon, Peter Zijlstra,
	Mark Rutland, Wedson Almeida Filho, Viresh Kumar, Lyude Paul,
	Ingo Molnar, Mitchell Levy, Paul E. McKenney, Greg Kroah-Hartman,
	Linus Torvalds, Thomas Gleixner, Alan Stern

Hi all,

This is the v7 of LKMM atomics in Rust, you can find the previous
versions at:

v6: https://lore.kernel.org/rust-for-linux/20250710060052.11955-1-boqun.feng@gmail.com/
v5: https://lore.kernel.org/rust-for-linux/20250618164934.19817-1-boqun.feng@gmail.com/
v4: https://lore.kernel.org/rust-for-linux/20250609224615.27061-1-boqun.feng@gmail.com/
v3: https://lore.kernel.org/rust-for-linux/20250421164221.1121805-1-boqun.feng@gmail.com/
v2: https://lore.kernel.org/rust-for-linux/20241101060237.1185533-1-boqun.feng@gmail.com/
v1: https://lore.kernel.org/rust-for-linux/20240612223025.1158537-1-boqun.feng@gmail.com/
wip: https://lore.kernel.org/rust-for-linux/20240322233838.868874-1-boqun.feng@gmail.com/

I think I resolved most of the comments from the last version. I do
really want to see if this can be in v6.17-rc1, please take a look.

Changes since v6:

- Changed the macro format of atomic/ops.rs and improved the safety
  requirements per the suggestion of Benno.
- Used fine-grained trait design like `AllowAtomicAdd` for arithmetic
  operations per the suggestion of Benno.
- Added an `isize_atomic_repr` internal type to reduce the #[cfg(_)]
  usage for implementing Atomic<{i,u}size> per suggestion of Miguel.
- Made barrier functions always inline.
- Documentation and safety comment improvement. Thanks Benno!

Regards,
Boqun

Boqun Feng (9):
  rust: Introduce atomic API helpers
  rust: sync: Add basic atomic operation mapping framework
  rust: sync: atomic: Add ordering annotation types
  rust: sync: atomic: Add generic atomics
  rust: sync: atomic: Add atomic {cmp,}xchg operations
  rust: sync: atomic: Add the framework of arithmetic operations
  rust: sync: atomic: Add Atomic<u{32,64}>
  rust: sync: Add memory barriers
  rust: sync: atomic: Add Atomic<{usize,isize}>

 MAINTAINERS                               |    4 +-
 rust/helpers/atomic.c                     | 1040 +++++++++++++++++++++
 rust/helpers/barrier.c                    |   18 +
 rust/helpers/helpers.c                    |    2 +
 rust/kernel/sync.rs                       |    2 +
 rust/kernel/sync/atomic.rs                |  187 ++++
 rust/kernel/sync/atomic/generic.rs        |  573 ++++++++++++
 rust/kernel/sync/atomic/ops.rs            |  265 ++++++
 rust/kernel/sync/atomic/ordering.rs       |  109 +++
 rust/kernel/sync/barrier.rs               |   61 ++
 scripts/atomic/gen-atomics.sh             |    1 +
 scripts/atomic/gen-rust-atomic-helpers.sh |   67 ++
 12 files changed, 2328 insertions(+), 1 deletion(-)
 create mode 100644 rust/helpers/atomic.c
 create mode 100644 rust/helpers/barrier.c
 create mode 100644 rust/kernel/sync/atomic.rs
 create mode 100644 rust/kernel/sync/atomic/generic.rs
 create mode 100644 rust/kernel/sync/atomic/ops.rs
 create mode 100644 rust/kernel/sync/atomic/ordering.rs
 create mode 100644 rust/kernel/sync/barrier.rs
 create mode 100755 scripts/atomic/gen-rust-atomic-helpers.sh

-- 
2.39.5 (Apple Git-154)


^ permalink raw reply	[flat|nested] 50+ messages in thread

end of thread, other threads:[~2025-07-16 17:38 UTC | newest]

Thread overview: 50+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-14  5:36 [PATCH v7 0/9] LKMM generic atomics in Rust Boqun Feng
2025-07-14  5:36 ` [PATCH v7 1/9] rust: Introduce atomic API helpers Boqun Feng
2025-07-16  9:23   ` Greg Kroah-Hartman
2025-07-16 12:36     ` Miguel Ojeda
2025-07-16 12:47     ` Peter Zijlstra
2025-07-16 12:54       ` Greg Kroah-Hartman
2025-07-16 12:57         ` Miguel Ojeda
2025-07-16 13:04           ` Peter Zijlstra
2025-07-16 12:56       ` Miguel Ojeda
2025-07-14  5:36 ` [PATCH v7 2/9] rust: sync: Add basic atomic operation mapping framework Boqun Feng
2025-07-14 10:03   ` Benno Lossin
2025-07-14 13:42     ` Boqun Feng
2025-07-14 15:00       ` Benno Lossin
2025-07-14 15:34         ` Boqun Feng
2025-07-14  5:36 ` [PATCH v7 3/9] rust: sync: atomic: Add ordering annotation types Boqun Feng
2025-07-14 10:10   ` Benno Lossin
2025-07-14 14:59     ` Boqun Feng
2025-07-14 15:16       ` Benno Lossin
2025-07-14  5:36 ` [PATCH v7 4/9] rust: sync: atomic: Add generic atomics Boqun Feng
2025-07-14 10:30   ` Benno Lossin
2025-07-14 14:21     ` Boqun Feng
2025-07-14 14:30       ` Boqun Feng
2025-07-14 14:34       ` Miguel Ojeda
2025-07-14 14:53         ` Boqun Feng
2025-07-14 15:16           ` Benno Lossin
2025-07-14 15:05       ` Benno Lossin
2025-07-14 15:32         ` Boqun Feng
2025-07-15  9:36           ` Benno Lossin
2025-07-15 13:14             ` Boqun Feng
2025-07-15 15:35               ` Benno Lossin
2025-07-14  5:36 ` [PATCH v7 5/9] rust: sync: atomic: Add atomic {cmp,}xchg operations Boqun Feng
2025-07-14 10:56   ` Benno Lossin
2025-07-14  5:36 ` [PATCH v7 6/9] rust: sync: atomic: Add the framework of arithmetic operations Boqun Feng
2025-07-15 11:21   ` Benno Lossin
2025-07-15 13:33     ` Boqun Feng
2025-07-15 15:45       ` Benno Lossin
2025-07-15 16:13         ` Boqun Feng
2025-07-15 18:39           ` Benno Lossin
2025-07-15 20:13             ` Boqun Feng
2025-07-16 10:25               ` Benno Lossin
2025-07-16 14:13                 ` Boqun Feng
2025-07-16 15:36                   ` Benno Lossin
2025-07-16 15:48                     ` Boqun Feng
2025-07-16 17:16                       ` Benno Lossin
2025-07-16 17:38                         ` Boqun Feng
2025-07-14  5:36 ` [PATCH v7 7/9] rust: sync: atomic: Add Atomic<u{32,64}> Boqun Feng
2025-07-14  5:36 ` [PATCH v7 8/9] rust: sync: Add memory barriers Boqun Feng
2025-07-14  5:36 ` [PATCH v7 9/9] rust: sync: atomic: Add Atomic<{usize,isize}> Boqun Feng
2025-07-14 11:06   ` Benno Lossin
2025-07-14 13:47     ` Boqun Feng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).