Re: [RFC PATCH 13/37] mm: implement speculative handling in __handle_mm_fault().

From: Matthew Wilcox
Date: Thu Apr 29 2021 - 14:50:08 EST


On Thu, Apr 29, 2021 at 11:34:12AM -0700, Paul E. McKenney wrote:
> +++ b/include/linux/rcupdate.h
> @@ -532,7 +532,10 @@ do { \
> * @p: The pointer to read, prior to dereferencing
> * @c: The conditions under which the dereference will take place
> *
> - * This is the RCU-bh counterpart to rcu_dereference_check().
> + * This is the RCU-bh counterpart to rcu_dereference_check(). However,
> + * please note that in recent kernels, synchronize_rcu() waits for
> + * local_bh_disable() regions of code in addition to regions of code
> + * demarked by rcu_read_lock() and rcu_read_unlock().
> */

I've been trying to get rid of "please note that" in my own documentation
recently. It doesn't add any value. Also, "recent kernels" is going to
go stale quickly, "Since v5.8" (or whatever) is good because it lets us
know in ten years that we can just delete the reference.

So I'd make this:

* This is the RCU-bh equivalent of rcu_dereference_check(). Since v5.8,
* synchronize_rcu() waits for code with bottom halves disabled as well
* as code between rcu_read_lock() and rcu_read_unlock().