Messages in this thread |  | | Subject | Re: [PATCH tip/core/urgent 4/7] rcu: protect __rcu_read_unlock() against scheduler-using irq handlers | | From | Peter Zijlstra <> | | Date | Wed, 20 Jul 2011 14:54:27 +0200 |
| |
On Tue, 2011-07-19 at 17:18 -0700, Paul E. McKenney wrote: > @@ -391,10 +400,15 @@ void __rcu_read_unlock(void) > struct task_struct *t = current; > > barrier(); /* needed if we ever invoke rcu_read_unlock in rcutree.c */ > - if (--t->rcu_read_lock_nesting == 0) { > - barrier(); /* decr before ->rcu_read_unlock_special load */ > + if (t->rcu_read_lock_nesting != 1) > + --t->rcu_read_lock_nesting; > + else { > + t->rcu_read_lock_nesting = INT_MIN; > + barrier(); /* assign before ->rcu_read_unlock_special load */ > if (unlikely(ACCESS_ONCE(t->rcu_read_unlock_special))) > rcu_read_unlock_special(t); > + barrier(); /* ->rcu_read_unlock_special load before assign */ > + t->rcu_read_lock_nesting = 0; > } > #ifdef CONFIG_PROVE_LOCKING > WARN_ON_ONCE(ACCESS_ONCE(t->rcu_read_lock_nesting) < 0);
But won't the above change make that WARN_ON_ONCE() invalid?
|  |