rcu/nocb: Introduce nocb mutex
authorFrederic Weisbecker <frederic@kernel.org>
Thu, 30 May 2024 13:45:45 +0000 (15:45 +0200)
committerNeeraj Upadhyay <neeraj.upadhyay@kernel.org>
Mon, 29 Jul 2024 02:04:31 +0000 (07:34 +0530)
commit7121dd915a262aee1f5a88cf86b1543f3a9439d7
tree03711242df5dd69dd2300fa108c60a622177bac1
parent7be88a857eb84d2e0677690b81ee423dee51c93d
rcu/nocb: Introduce nocb mutex

The barrier_mutex is used currently to protect (de-)offloading
operations and prevent from nocb_lock locking imbalance in rcu_barrier()
and shrinker, and also from misordered RCU barrier invocation.

Now since RCU (de-)offloading is going to happen on offline CPUs, an RCU
barrier will have to be executed while transitionning from offloaded to
de-offloaded state. And this can't happen while holding the
barrier_mutex.

Introduce a NOCB mutex to protect (de-)offloading transitions. The
barrier_mutex is still held for now when necessary to avoid barrier
callbacks reordering and nocb_lock imbalance.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Reviewed-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Neeraj Upadhyay <neeraj.upadhyay@kernel.org>
kernel/rcu/tree.c
kernel/rcu/tree.h
kernel/rcu/tree_nocb.h
kernel/rcu/tree_plugin.h