[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201015161519.GW3249@paulmck-ThinkPad-P72>
Date: Thu, 15 Oct 2020 09:15:19 -0700
From: "Paul E. McKenney" <paulmck@...nel.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Boqun Feng <boqun.feng@...il.com>, Qian Cai <cai@...hat.com>,
Steven Rostedt <rostedt@...dmis.org>,
Ingo Molnar <mingo@...nel.org>, x86 <x86@...nel.org>,
linux-kernel@...r.kernel.org, linux-tip-commits@...r.kernel.org,
Linux Next Mailing List <linux-next@...r.kernel.org>,
Stephen Rothwell <sfr@...b.auug.org.au>
Subject: Re: [tip: locking/core] lockdep: Fix lockdep recursion
On Thu, Oct 15, 2020 at 11:50:33AM +0200, Peter Zijlstra wrote:
> On Thu, Oct 15, 2020 at 11:49:26AM +0200, Peter Zijlstra wrote:
> > --- a/kernel/rcu/tree.c
> > +++ b/kernel/rcu/tree.c
> > @@ -1143,13 +1143,15 @@ bool rcu_lockdep_current_cpu_online(void
> > struct rcu_data *rdp;
> > struct rcu_node *rnp;
> > bool ret = false;
> > + unsigned long seq;
> >
> > if (in_nmi() || !rcu_scheduler_fully_active)
> > return true;
> > preempt_disable_notrace();
> > rdp = this_cpu_ptr(&rcu_data);
> > rnp = rdp->mynode;
> > - if (rdp->grpmask & rcu_rnp_online_cpus(rnp))
> > + seq = READ_ONCE(rnp->ofl_seq) & ~0x1;
> > + if (rdp->grpmask & rcu_rnp_online_cpus(rnp) || seq != READ_ONCE(rnp->ofl_seq))
> > ret = true;
> > preempt_enable_notrace();
> > return ret;
>
> Also, here, are the two loads important? Wouldn't:
>
> || READ_ONCE(rnp->ofl_seq) & 0x1
>
> be sufficient?
Indeed it would! Good catch, thank you!!!
Thanx, Paul
Powered by blists - more mailing lists