McKenney: So You Want to Rust the Linux Kernel?
McKenney: So You Want to Rust the Linux Kernel?
Posted Oct 8, 2021 4:05 UTC (Fri) by neilbrown (subscriber, #359)In reply to: McKenney: So You Want to Rust the Linux Kernel? by PaulMcKenney
Parent article: McKenney: So You Want to Rust the Linux Kernel?
Part 7 suggests that RCU "vaguely resembles a reader-writer lock". I don't find that to be a helpful analogy, and have come to dislike the name "rcu_read_lock()" (preferring rcu_get()/rcu_put())
The only thing that RCU and rwlocks have in common is a refcount, and that is where I would build an analogy.
The only thing that RCU and rwlocks have in common is a refcount, and that is where I would build an analogy.
RCU provides an effective reference-count on *all* objects accessible through __rcu pointers, combined with a mechanism to get notifications when all previously claimed references have been dropped. It is similar to kref_get/kref_put with the counter being global and the 'release' function passed to kref_put() being asynchronous.
But maybe this analogy isn't SO much better that it can overcome a natural resistance to change.
