[PATCH 0/5] rust: sync: Atomic pointer and RCU

Boqun Feng posted 5 patches 3 weeks ago
rust/helpers/atomic_ext.c            | 158 +++++--------
rust/kernel/sync/atomic.rs           |  12 +-
rust/kernel/sync/atomic/internal.rs  |  21 +-
rust/kernel/sync/atomic/predefine.rs |  23 ++
rust/kernel/sync/rcu.rs              | 326 ++++++++++++++++++++++++++-
5 files changed, 427 insertions(+), 113 deletions(-)
[PATCH 0/5] rust: sync: Atomic pointer and RCU
Posted by Boqun Feng 3 weeks ago
Hi,

This is a respin of my previous RCU pointer patch [1]. RCU protected
pointers maps to a "struct foo __rcu *" on the C side, which although
RCU has its own API, but fundamentally it's a pointer that are operated
atomically, hence using Rust's atomic (pointer) API provides the
necessary atomic + ordering.

Although asynchronous reclaim is not in the current implementation, but
it should be easy to extend.

[1]: https://lore.kernel.org/rust-for-linux/20250421164221.1121805-13-boqun.feng@gmail.com/

Regards,
Boqun

Boqun Feng (5):
  rust: helpers: Generify the definitions of rust_helper_*_{read,set}*
  rust: helpers: Generify the definitions of rust_helper_*_xchg*
  rust: helpers: Generify the definitions of rust_helper_*_cmpxchg*
  rust: sync: atomic: Add Atomic<*mut T> support
  rust: sync: rcu: Add RCU protected pointer

 rust/helpers/atomic_ext.c            | 158 +++++--------
 rust/kernel/sync/atomic.rs           |  12 +-
 rust/kernel/sync/atomic/internal.rs  |  21 +-
 rust/kernel/sync/atomic/predefine.rs |  23 ++
 rust/kernel/sync/rcu.rs              | 326 ++++++++++++++++++++++++++-
 5 files changed, 427 insertions(+), 113 deletions(-)

-- 
2.51.0