Subject: Re: [PATCH net-next] tcp: use 2-arg optimal variant of kfree_rcu()

From: Uladzislau Rezki <[email-masked]>
Date: Mon, 5 Dec 2022 15:59:01 +0100

> On Mon, Dec 5, 2022 at 12:09 PM Uladzislau Rezki <[email-masked]> wrote:
> >
> > Hello, Eric.
> >
> > > +rcu for archives
> > >
> > > > On Dec 2, 2022, at 7:16 PM, Joel Fernandes <[email-masked]> wrote:
> > > >
> > > > On Sat, Dec 3, 2022 at 12:12 AM Joel Fernandes <[email-masked]> wrote:
> > > >>
> > > >>> On Sat, Dec 3, 2022 at 12:03 AM Paul E. McKenney <[email-masked]> wrote:
> > > >>>
> > > >>> On Fri, Dec 02, 2022 at 11:49:59PM +0000, Joel Fernandes wrote:
> > > >>>> On Fri, Dec 02, 2022 at 05:28:47AM +0000, Eric Dumazet wrote:
> > > >>>>> kfree_rcu(1-arg) should be avoided as much as possible,
> > > >>>>> since this is only possible from sleepable contexts,
> > > >>>>> and incurr extra rcu barriers.
> > > >>>>>
> > > >>>>> I wish the 1-arg variant of kfree_rcu() would
> > > >>>>> get a distinct name, like kfree_rcu_slow()
> > > >>>>> to avoid it being abused.
> > >
> > <snip>
> > tcp: use 2-arg optimal variant of kfree_rcu()
> > Date: Fri,  2 Dec 2022 05:28:47 +0000   [thread overview]
> > Message-ID: <[email-masked]> (raw)
> >
> > kfree_rcu(1-arg) should be avoided as much as possible,
> > since this is only possible from sleepable contexts,
> > and incurr extra rcu barriers.
> >
> > I wish the 1-arg variant of kfree_rcu() would
> > get a distinct name, like kfree_rcu_slow()
> > to avoid it being abused.
> >
> > Fixes: 459837b522f7 ("net/tcp: Disable TCP-MD5 static key on tcp_md5sig_info destruction")
> > Signed-off-by: Eric Dumazet <[email-masked]>
> > Cc: Dmitry Safonov <[email-masked]>
> > Cc: Paul E. McKenney <[email-masked]>
> > <snip>
> >
> > Could you please clarify a little bit about why/how have you came
> > up with a patch that you posted with "Fixes" tag? I mean you run
> > into:
> >   - performance degrade;
> >   - simple typo;
> >   - etc.
> 
> Bug was added in the blamed commit, we use Fixes: tag to clearly
> identify bug origin.
> 
> tcp_md5_key_copy()  is called from softirq context, there is no way it
> could sleep in synchronize_rcu()
>
So it was a typo then. How did you identify that BUG? Simple go through
the code? Or some test coverage?

Thank you!

--
Uladzislau Rezki