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: <827b1dbc-beff-4b81-a90e-3bcc7c3b3a30@paulmck-laptop>
Date:   Wed, 1 Nov 2023 09:52:05 -0700
From:   "Paul E. McKenney" <paulmck@...nel.org>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     Z qiang <qiang.zhang1211@...il.com>,
        Waiman Long <longman@...hat.com>,
        Ingo Molnar <mingo@...hat.com>,
        Juri Lelli <juri.lelli@...hat.com>,
        Vincent Guittot <vincent.guittot@...aro.org>,
        Dietmar Eggemann <dietmar.eggemann@....com>,
        Steven Rostedt <rostedt@...dmis.org>,
        Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
        Daniel Bristot de Oliveira <bristot@...hat.com>,
        Valentin Schneider <vschneid@...hat.com>,
        linux-kernel@...r.kernel.org, Phil Auld <pauld@...hat.com>,
        kernel test robot <oliver.sang@...el.com>,
        aubrey.li@...ux.intel.com, yu.c.chen@...el.com,
        frederic@...nel.org, quic_neeraju@...cinc.com,
        joel@...lfernandes.org, josh@...htriplett.org,
        boqun.feng@...il.com, mathieu.desnoyers@...icios.com,
        jiangshanlai@...il.com
Subject: Re: [PATCH] rcu: Break rcu_node_0 --> &rq->__lock order

On Wed, Nov 01, 2023 at 03:38:14PM +0100, Peter Zijlstra wrote:
> On Wed, Nov 01, 2023 at 07:21:09PM +0800, Z qiang wrote:
> 
> > >  static int rcu_implicit_dynticks_qs(struct rcu_data *rdp)
> > >  {
> > >         unsigned long jtsq;
> > > +       int ret = 0;
> > >         struct rcu_node *rnp = rdp->mynode;
> > >
> > >         /*
> > > @@ -847,8 +852,8 @@ static int rcu_implicit_dynticks_qs(stru
> > >             (time_after(jiffies, READ_ONCE(rdp->last_fqs_resched) + jtsq * 3) ||
> > >              rcu_state.cbovld)) {
> > >                 WRITE_ONCE(rdp->rcu_urgent_qs, true);
> > > -               resched_cpu(rdp->cpu);
> > >                 WRITE_ONCE(rdp->last_fqs_resched, jiffies);
> > > +               ret = -1;
> > >         }
> > >
> > 
> > 
> > Maybe some modifications are missing here:
> > 
> > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> > index aa4c808978b8..77e7a0dc722a 100644
> > --- a/kernel/rcu/tree.c
> > +++ b/kernel/rcu/tree.c
> > @@ -867,8 +867,8 @@ static int rcu_implicit_dynticks_qs(struct rcu_data *rdp)
> >         if (time_after(jiffies, rcu_state.jiffies_resched)) {
> >                 if (time_after(jiffies,
> >                                READ_ONCE(rdp->last_fqs_resched) + jtsq)) {
> > -                       resched_cpu(rdp->cpu);
> >                         WRITE_ONCE(rdp->last_fqs_resched, jiffies);
> > +                       ret = -1;
> >                 }
> >                 if (IS_ENABLED(CONFIG_IRQ_WORK) &&
> >                     !rdp->rcu_iw_pending && rdp->rcu_iw_gp_seq != rnp->gp_seq &&
> > 
> > 
> 
> Bah, you're quite right, I missed that there were two sites calling
> resched_cpu().
> 
> Paul, do you want a fixed up version or will you fold in the fix?

I can fold it in.  I also clearly need to add a 15-second stall to at
least one of the rcutorture scenarios to exercise this code path...

(And Frederic might be pushing this one, his choice.)

							Thanx, Paul

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ