diff options
author | Paul E. McKenney <paulmck@linux.ibm.com> | 2019-05-28 07:18:08 -0700 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.ibm.com> | 2019-08-13 14:35:49 -0700 |
commit | 81c0b3d724f419c0524f432c1ac22b9f518c2899 (patch) | |
tree | 06456d42837dee4892ddf6b01700f36ae749bbe7 /drivers/hv | |
parent | 7f36ef82e5cf0b401c2676fb3e56ad0633ed6ad5 (diff) | |
download | linux-81c0b3d724f419c0524f432c1ac22b9f518c2899.tar.bz2 |
rcu/nocb: Avoid ->nocb_lock capture by corresponding CPU
A given rcu_data structure's ->nocb_lock can be acquired very frequently
by the corresponding CPU and occasionally by the corresponding no-CBs
grace-period and callbacks kthreads. In particular, these two kthreads
will have frequent gaps between ->nocb_lock acquisitions that are roughly
a grace period in duration. This means that any excessive ->nocb_lock
contention will be due to the CPU's acquisitions, and this in turn
enables a very naive contention-avoidance strategy to be quite effective.
This commit therefore modifies rcu_nocb_lock() to first
attempt a raw_spin_trylock(), and to atomically increment a
separate ->nocb_lock_contended across a raw_spin_lock(). This new
->nocb_lock_contended field is checked in __call_rcu_nocb_wake() when
interrupts are enabled, with a spin-wait for contending acquisitions
to complete, thus allowing the kthreads a chance to acquire the lock.
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Diffstat (limited to 'drivers/hv')
0 files changed, 0 insertions, 0 deletions