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: <CAL+tcoAQdSzO+WkWadrA_wijEOUKuua-244jGewG_VrRC-2jLQ@mail.gmail.com>
Date: Thu, 13 Feb 2025 09:01:04 +0800
From: Jason Xing <kerneljasonxing@...il.com>
To: Mina Almasry <almasrymina@...gle.com>
Cc: davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org, 
	pabeni@...hat.com, hawk@...nel.org, ilias.apalodimas@...aro.org, 
	horms@...nel.org, netdev@...r.kernel.org
Subject: Re: [PATCH net-next v1] page_pool: avoid infinite loop to schedule
 delayed worker

On Thu, Feb 13, 2025 at 8:51 AM Mina Almasry <almasrymina@...gle.com> wrote:
>
> On Wed, Feb 12, 2025 at 4:44 PM Jason Xing <kerneljasonxing@...il.com> wrote:
> > >
> > > ```
> > > diff --git a/net/core/page_pool.c b/net/core/page_pool.c
> > > index 2ea8041aba7e..6d62ea45571b 100644
> > > --- a/net/core/page_pool.c
> > > +++ b/net/core/page_pool.c
> > > @@ -1113,13 +1113,12 @@ static void page_pool_release_retry(struct
> > > work_struct *wq)
> > >         int inflight;
> > >
> > >         inflight = page_pool_release(pool);
> > > -       if (!inflight)
> > > -               return;
> > >
> > >         /* Periodic warning for page pools the user can't see */
> > >         netdev = READ_ONCE(pool->slow.netdev);
> > >         if (time_after_eq(jiffies, pool->defer_warn) &&
> > > -           (!netdev || netdev == NET_PTR_POISON)) {
> > > +           (!netdev || netdev == NET_PTR_POISON) &&
> > > +           inflight != 0) {
> > >                 int sec = (s32)((u32)jiffies - (u32)pool->defer_start) / HZ;
> > >
> > >                 pr_warn("%s() stalled pool shutdown: id %u, %d
> > > inflight %d sec devmem=%d\n",
> > > @@ -1128,7 +1127,15 @@ static void page_pool_release_retry(struct
> > > work_struct *wq)
> > >                 pool->defer_warn = jiffies + DEFER_WARN_INTERVAL;
> > >         }
> > >
> > > -       /* Still not ready to be disconnected, retry later */
> > > +       /* In rare cases, a driver bug may cause inflight to go negative. Don't
> > > +        * reschedule release if inflight is 0 or negative.
> > > +        *      - If 0, the page_pool has been destroyed
> > > +        *      - if negative, we will never recover
> > > +        * in both cases no reschedule necessary.
> > > +        */
> > > +       if (inflight < 1)
> >
> > Maybe I would change the above to 'inflight <= 0' which looks more
> > obvious at the first glance? :)
> >
>
> Good catch. Yes.
>
> Also, write "no reschedule is necessary" on the last line in the
> comment (add "is")

Will adjust it. Thanks!

>
> --
> Thanks,
> Mina

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ