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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAAhV-H6MWOVkgJYa6CedoiQ9YG+Jw_vTLZN-NY5Jrn5Ps5HUAg@mail.gmail.com>
Date:   Thu, 24 Aug 2023 20:52:30 +0800
From:   Huacai Chen <chenhuacai@...nel.org>
To:     Thomas Gleixner <tglx@...utronix.de>
Cc:     Huacai Chen <chenhuacai@...ngson.cn>,
        "Paul E . McKenney" <paulmck@...nel.org>,
        Frederic Weisbecker <frederic@...nel.org>,
        Neeraj Upadhyay <quic_neeraju@...cinc.com>,
        Joel Fernandes <joel@...lfernandes.org>,
        Josh Triplett <josh@...htriplett.org>,
        Boqun Feng <boqun.feng@...il.com>,
        Steven Rostedt <rostedt@...dmis.org>,
        Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
        Lai Jiangshan <jiangshanlai@...il.com>,
        Zqiang <qiang.zhang1211@...il.com>,
        Sergey Senozhatsky <senozhatsky@...omium.org>,
        rcu@...r.kernel.org, linux-kernel@...r.kernel.org,
        stable@...r.kernel.org, Binbin Zhou <zhoubinbin@...ngson.cn>
Subject: Re: [PATCH V3] rcu: Update jiffies locally in rcu_cpu_stall_reset()

Hi, Thomas,

On Thu, Aug 24, 2023 at 5:37 PM Thomas Gleixner <tglx@...utronix.de> wrote:
>
> On Tue, Aug 22 2023 at 12:02, Huacai Chen wrote:
> > + * This function may be called in NMI context, so we cannot use ktime_get_ns()
> > + * and ktime_get_coarse_ns(). Instead, we use their inaccurate but safe friends
> > + * ktime_get_mono_fast_ns() and ktime_get_seconds() which will cause rcu_state.
> > + * jiffies_stall to be a little large than expected (harmless and safer).
>
> What's inaccurate about ktime_get_mono_fast_ns()? Bogus comments are
> even worse than no comments.
ktime_get_mono_fast_ns() is not as accurate as ktime_get_ns(), I get
this conclusion from:

 * So if the update lowers the slope, readers who are forced to the
 * not yet updated second array are still using the old steeper slope.

>
> >   */
> >  void rcu_cpu_stall_reset(void)
> >  {
> > +     u64 curr, last, delta;
> > +
> > +     curr = ktime_get_mono_fast_ns();
> > +     last = ktime_get_seconds() * NSEC_PER_SEC;
>
> So this will trigger a warning when someone debugs suspend with KGDB.
Yes, ktime_get_seconds() may cause a warning, I haven't noticed this before.

>
> It seems the approach taken here seems to be to throw stuff at the wall
> and see what sticks.
I don't understand what's meaning, but I believe your advice in
another thread is the best solution, so let me try.

Huacai

>
> Thanks,
>
>         tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ