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/[email protected]/ 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

