[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3731b8da4dc46febc8adef331d6c97b21283428a.camel@infradead.org>
Date: Thu, 09 Dec 2021 18:43:30 +0000
From: David Woodhouse <dwmw2@...radead.org>
To: Neeraj Upadhyay <quic_neeraju@...cinc.com>,
Thomas Gleixner <tglx@...utronix.de>
Cc: Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
"H. Peter Anvin" <hpa@...or.com>,
Paolo Bonzini <pbonzini@...hat.com>,
"Paul E. McKenney" <paulmck@...nel.org>,
linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
rcu@...r.kernel.org, mimoja@...oja.de, hewenliang4@...wei.com,
hushiyuan@...wei.com, luolongjun@...wei.com, hejingxian@...wei.com
Subject: Re: [PATCH 02/11] rcu: Kill rnp->ofl_seq and use only
rcu_state.ofl_lock for exclusion
On Fri, 2021-12-10 at 00:01 +0530, Neeraj Upadhyay wrote:
> > @@ -4246,11 +4249,11 @@ void rcu_cpu_starting(unsigned int cpu)
> >
> > rnp = rdp->mynode;
> > mask = rdp->grpmask;
> > - WRITE_ONCE(rnp->ofl_seq, rnp->ofl_seq + 1);
> > - WARN_ON_ONCE(!(rnp->ofl_seq & 0x1));
> > + local_irq_save(seq_flags);
> > + arch_spin_lock(&rcu_state.ofl_lock);
> > rcu_dynticks_eqs_online();
> > smp_mb(); // Pair with rcu_gp_cleanup()'s ->ofl_seq barrier().
>
> Can we drop this smp_mb(),as arch_spin_lock(&rcu_state.ofl_lock)
> provides the ordering now?
Yes, thanks.
> > - raw_spin_lock_irqsave_rcu_node(rnp, flags);
> > + raw_spin_lock_rcu_node(rnp);
> > WRITE_ONCE(rnp->qsmaskinitnext, rnp->qsmaskinitnext | mask);
> > newcpu = !(rnp->expmaskinitnext & mask);
> > rnp->expmaskinitnext |= mask;
> > @@ -4269,9 +4272,8 @@ void rcu_cpu_starting(unsigned int cpu)
> > } else {
> > raw_spin_unlock_irqrestore_rcu_node(rnp, flags);
>
> 'flags' is uninitialized now?
Ah yes, that suffered from the fact that saving the flags is pointless
because we know we already disabled interrupts... but
rcu_report_qs_rnp() *really* wants to be given some flags to restore.
Will fix that too; thanks again.
Download attachment "smime.p7s" of type "application/pkcs7-signature" (5174 bytes)
Powered by blists - more mailing lists