Commit 6aacd88d authored by Paul E. McKenney's avatar Paul E. McKenney

rcu/nocb: EXP Check use and usefulness of ->nocb_lock_contended

Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.ibm.com>
parent d1b222c6
...@@ -1515,6 +1515,7 @@ static void rcu_nocb_bypass_lock(struct rcu_data *rdp) ...@@ -1515,6 +1515,7 @@ static void rcu_nocb_bypass_lock(struct rcu_data *rdp)
if (raw_spin_trylock(&rdp->nocb_bypass_lock)) if (raw_spin_trylock(&rdp->nocb_bypass_lock))
return; return;
atomic_inc(&rdp->nocb_lock_contended); atomic_inc(&rdp->nocb_lock_contended);
WARN_ON_ONCE(smp_processor_id() != rdp->cpu);
smp_mb__after_atomic(); /* atomic_inc() before lock. */ smp_mb__after_atomic(); /* atomic_inc() before lock. */
raw_spin_lock(&rdp->nocb_bypass_lock); raw_spin_lock(&rdp->nocb_bypass_lock);
smp_mb__before_atomic(); /* atomic_dec() after lock. */ smp_mb__before_atomic(); /* atomic_dec() after lock. */
...@@ -1533,7 +1534,8 @@ static void rcu_nocb_bypass_lock(struct rcu_data *rdp) ...@@ -1533,7 +1534,8 @@ static void rcu_nocb_bypass_lock(struct rcu_data *rdp)
*/ */
static void rcu_nocb_wait_contended(struct rcu_data *rdp) static void rcu_nocb_wait_contended(struct rcu_data *rdp)
{ {
while (atomic_read(&rdp->nocb_lock_contended)) WARN_ON_ONCE(smp_processor_id() != rdp->cpu);
while (WARN_ON_ONCE(atomic_read(&rdp->nocb_lock_contended)))
cpu_relax(); cpu_relax();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment