Messages in this thread |  | | Date | Wed, 20 Jul 2011 06:25:30 -0700 | | From | "Paul E. McKenney" <> | | Subject | Re: [PATCH tip/core/urgent 4/7] rcu: protect __rcu_read_unlock() against scheduler-using irq handlers |
| |
On Wed, Jul 20, 2011 at 02:54:27PM +0200, Peter Zijlstra wrote: > 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?
Yes, please see the patch I just sent. So that warning was spurious, and if that was the only problem...
Thanx, Paul
|  |