[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110720132530.GF2400@linux.vnet.ibm.com>
Date: Wed, 20 Jul 2011 06:25:30 -0700
From: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: linux-kernel@...r.kernel.org, mingo@...e.hu, laijs@...fujitsu.com,
dipankar@...ibm.com, akpm@...ux-foundation.org,
mathieu.desnoyers@...ymtl.ca, josh@...htriplett.org,
niv@...ibm.com, tglx@...utronix.de, rostedt@...dmis.org,
Valdis.Kletnieks@...edu, dhowells@...hat.com,
eric.dumazet@...il.com, darren@...art.com, patches@...aro.org,
greearb@...delatech.com, edt@....ca,
"Paul E. McKenney" <paul.mckenney@...aro.org>
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists