lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20211130184401.GX641268@paulmck-ThinkPad-P17-Gen-1>
Date:   Tue, 30 Nov 2021 10:44:01 -0800
From:   "Paul E. McKenney" <paulmck@...nel.org>
To:     Neeraj Upadhyay <quic_neeraju@...cinc.com>
Cc:     Frederic Weisbecker <frederic@...nel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Uladzislau Rezki <urezki@...il.com>,
        Boqun Feng <boqun.feng@...il.com>,
        Josh Triplett <josh@...htriplett.org>,
        Joel Fernandes <joel@...lfernandes.org>, rcu@...r.kernel.org
Subject: Re: [PATCH] rcu/exp: Mark current CPU as exp-QS in IPI loop second
 pass

On Tue, Nov 30, 2021 at 10:31:57PM +0530, Neeraj Upadhyay wrote:
> 
> 
> On 11/30/2021 9:51 PM, Frederic Weisbecker wrote:
> > While looping through the rnp's CPUs to IPI for an expedited grace
> > period, a first pass excludes the current CPU and the CPUs in dynticks
> > idle mode. The workqueue will report their QS on their behalf later.
> > 
> > The second pass processes the IPIs and also ignores the current CPU,
> > assuming it has been previously included in the group of CPUs whose
> > QS are to be reported by the workqueue.
> > 
> > Unfortunately the current CPU may have changed between the first and
> > second pass, due to the rnp lock being dropped, re-enabling preemption.
> > As a result the current CPU, if different in the second pass, may be
> > ignored by the expedited grace period. No IPI will be sent to it
> > so it won't be requested to report an expedited quiescent state.
> > 
> > This ends up in an expedited grace period stall.
> > 
> > Fix this with including the current CPU in the second round in the group
> > of CPUs to report a QS for by the workqueue.
> > 
> > Fixes: b9ad4d6ed18e ("rcu: Avoid self-IPI in sync_rcu_exp_select_node_cpus()")
> > Signed-off-by: Frederic Weisbecker <frederic@...nel.org>
> > Cc: Uladzislau Rezki <urezki@...il.com>
> > Cc: Neeraj Upadhyay <quic_neeraju@...cinc.com>
> > Cc: Boqun Feng <boqun.feng@...il.com>
> > Cc: Josh Triplett <josh@...htriplett.org>
> > Cc: Joel Fernandes <joel@...lfernandes.org>
> > ---
> 
> Reviewed-by: Neeraj Upadhyay <quic_neeraju@...cinc.com>

Applied, thank you both!

							Thanx, Paul

> Thanks
> Neeraj
> 
> 
> >   kernel/rcu/tree_exp.h | 1 +
> >   1 file changed, 1 insertion(+)
> > 
> > diff --git a/kernel/rcu/tree_exp.h b/kernel/rcu/tree_exp.h
> > index a96d17206d87..237a79989aba 100644
> > --- a/kernel/rcu/tree_exp.h
> > +++ b/kernel/rcu/tree_exp.h
> > @@ -387,6 +387,7 @@ static void sync_rcu_exp_select_node_cpus(struct work_struct *wp)
> >   			continue;
> >   		}
> >   		if (get_cpu() == cpu) {
> > +			mask_ofl_test |= mask;
> >   			put_cpu();
> >   			continue;
> >   		}
> > 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ