rcu: Rework rcu_barrier() and callback-migration logic
authorPaul E. McKenney <paulmck@kernel.org>
Tue, 14 Dec 2021 21:15:18 +0000 (13:15 -0800)
committerPaul E. McKenney <paulmck@kernel.org>
Tue, 8 Feb 2022 18:12:28 +0000 (10:12 -0800)
commita16578dd5e3a44b53ca0699ac2971679dab97484
treeb1ccb9fd4b7a38ffcb6c93114059018b1ee7165d
parent0cabb47af3cfaeb6007ba3868379bbd4daee64cc
rcu: Rework rcu_barrier() and callback-migration logic

This commit reworks rcu_barrier() and callback-migration logic to
permit allowing rcu_barrier() to run concurrently with CPU-hotplug
operations.  The key trick is for callback migration to check to see if
an rcu_barrier() is in flight, and, if so, enqueue the ->barrier_head
callback on its behalf.

This commit adds synchronization with RCU's CPU-hotplug notifiers.  Taken
together, this will permit a later commit to remove the cpus_read_lock()
and cpus_read_unlock() calls from rcu_barrier().

[ paulmck: Updated per kbuild test robot feedback. ]
[ paulmck: Updated per reviews session with Neeraj, Frederic, Uladzislau, and Boqun. ]

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/tree.c
kernel/rcu/tree.h