[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
<BY3PR18MB4612227EE7818D9FDFA4BE4DAB7E9@BY3PR18MB4612.namprd18.prod.outlook.com>
Date: Wed, 17 May 2023 20:10:11 +0000
From: Manish Chopra <manishc@...vell.com>
To: Jakub Kicinski <kuba@...nel.org>
CC: Stephen Hemminger <stephen@...workplumber.org>,
"netdev@...r.kernel.org"
<netdev@...r.kernel.org>,
Ariel Elior <aelior@...vell.com>, Alok Prasad
<palok@...vell.com>,
Sudarsana Reddy Kalluru <skalluru@...vell.com>,
"David S
. Miller" <davem@...emloft.net>
Subject: RE: [EXT] Re: [PATCH v3 net] qed/qede: Fix scheduling while atomic
Hi Jakub,
> -----Original Message-----
> From: Jakub Kicinski <kuba@...nel.org>
> Sent: Wednesday, May 3, 2023 8:33 AM
> To: Manish Chopra <manishc@...vell.com>
> Cc: Stephen Hemminger <stephen@...workplumber.org>;
> netdev@...r.kernel.org; Ariel Elior <aelior@...vell.com>; Alok Prasad
> <palok@...vell.com>; Sudarsana Reddy Kalluru <skalluru@...vell.com>;
> David S . Miller <davem@...emloft.net>
> Subject: [EXT] Re: [PATCH v3 net] qed/qede: Fix scheduling while atomic
>
> External Email
>
> ----------------------------------------------------------------------
> On Fri, 28 Apr 2023 10:26:51 -0700 Stephen Hemminger wrote:
> > On Fri, 28 Apr 2023 09:13:37 -0700
> > Manish Chopra <manishc@...vell.com> wrote:
> >
> > > - usleep_range(1000, 2000);
> > > +
> > > + if (is_atomic)
> > > + udelay(QED_BAR_ACQUIRE_TIMEOUT_UDELAY);
> > > + else
> > > + usleep_range(QED_BAR_ACQUIRE_TIMEOUT_USLEEP,
> > > + QED_BAR_ACQUIRE_TIMEOUT_USLEEP *
> 2);
> > > }
> >
> > This is a variant of the conditional locking which is an ugly design pattern.
> > It makes static checking tools break and a source of more bugs.
> >
> > Better to fix the infrastructure or caller to not spin, or have two
> > different functions.
>
> FWIW the most common way to solve this issue is using a delayed work which
> reads out the stats periodically from a non-atomic context, and return a
> stashed copy from get_stat64.
Thanks for the suggestion, I will send v4 soon with required changes.
Regards,
Manish
Powered by blists - more mailing lists