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]
Date:   Fri, 11 Dec 2020 10:43:54 +0800
From:   Yejune Deng <yejune.deng@...il.com>
To:     Eric Dumazet <edumazet@...gle.com>
Cc:     David Miller <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Alexei Starovoitov <ast@...nel.org>,
        Andrii Nakryiko <andriin@...com>,
        Daniel Borkmann <daniel@...earbox.net>,
        Taehee Yoo <ap420073@...il.com>,
        Björn Töpel <bjorn.topel@...el.com>,
        Cong Wang <xiyou.wangcong@...il.com>,
        Jiri Pirko <jiri@...lanox.com>,
        netdev <netdev@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] net: core: fix msleep() is not accurate

Does anyone else have a different opinion? If not,I will adopt it and resubmit.

On Thu, Dec 10, 2020 at 6:19 PM Eric Dumazet <edumazet@...gle.com> wrote:
>
> On Thu, Dec 10, 2020 at 10:35 AM Yejune Deng <yejune.deng@...il.com> wrote:
> >
> > See Documentation/timers/timers-howto.rst, msleep() is not
> > for (1ms - 20ms), There is a more advanced API is used.
> >
> > Signed-off-by: Yejune Deng <yejune.deng@...il.com>
> > ---
> >  net/core/dev.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/net/core/dev.c b/net/core/dev.c
> > index d33099f..6e83ee03 100644
> > --- a/net/core/dev.c
> > +++ b/net/core/dev.c
> > @@ -6726,9 +6726,9 @@ void napi_disable(struct napi_struct *n)
> >         set_bit(NAPI_STATE_DISABLE, &n->state);
> >
> >         while (test_and_set_bit(NAPI_STATE_SCHED, &n->state))
> > -               msleep(1);
> > +               fsleep(1000);
> >         while (test_and_set_bit(NAPI_STATE_NPSVC, &n->state))
> > -               msleep(1);
> > +               fsleep(1000);
> >
>
> I would prefer explicit usleep_range().
>
> fsleep() is not common in the kernel, I had to go to its definition.
>
> I would argue that we should  use usleep_range(10, 200)  to have an
> opportunity to spend less time in napi_disable() in some cases.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ