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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAL+tcoD6+0gSMS2rOiOOFpnJ=iyYYJuNMg8+mNXBqCOYyeo5uw@mail.gmail.com>
Date: Mon, 20 Oct 2025 15:01:46 +0800
From: Jason Xing <kerneljasonxing@...il.com>
To: Eric Dumazet <edumazet@...gle.com>
Cc: Alexander Lobakin <aleksander.lobakin@...el.com>, "David S . Miller" <davem@...emloft.net>, 
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>, 
	Jamal Hadi Salim <jhs@...atatu.com>, Cong Wang <xiyou.wangcong@...il.com>, 
	Jiri Pirko <jiri@...nulli.us>, Kuniyuki Iwashima <kuniyu@...gle.com>, 
	Willem de Bruijn <willemb@...gle.com>, netdev@...r.kernel.org, eric.dumazet@...il.com
Subject: Re: [PATCH v2 net-next 2/6] net: add add indirect call wrapper in skb_release_head_state()

On Wed, Oct 15, 2025 at 8:46 PM Eric Dumazet <edumazet@...gle.com> wrote:
>
> On Wed, Oct 15, 2025 at 5:30 AM Alexander Lobakin
> <aleksander.lobakin@...el.com> wrote:
> >
> > From: Eric Dumazet <edumazet@...gle.com>
> > Date: Wed, 15 Oct 2025 05:16:05 -0700
> >
> > > On Wed, Oct 15, 2025 at 5:02 AM Alexander Lobakin
> > > <aleksander.lobakin@...el.com> wrote:
> > >>
> > >> From: Eric Dumazet <edumazet@...gle.com>
> > >> Date: Tue, 14 Oct 2025 17:19:03 +0000
> > >>
> > >>> While stress testing UDP senders on a host with expensive indirect
> > >>> calls, I found cpus processing TX completions where showing
> > >>> a very high cost (20%) in sock_wfree() due to
> > >>> CONFIG_MITIGATION_RETPOLINE=y.
> > >>>
> > >>> Take care of TCP and UDP TX destructors and use INDIRECT_CALL_3() macro.
> > >>>
> > >>> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> > >>> ---
> > >>>  net/core/skbuff.c | 11 ++++++++++-
> > >>>  1 file changed, 10 insertions(+), 1 deletion(-)
> > >>>
> > >>> diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> > >>> index bc12790017b0..692e3a70e75e 100644
> > >>> --- a/net/core/skbuff.c
> > >>> +++ b/net/core/skbuff.c
> > >>> @@ -1136,7 +1136,16 @@ void skb_release_head_state(struct sk_buff *skb)
> > >>>       skb_dst_drop(skb);
> > >>>       if (skb->destructor) {
> > >>>               DEBUG_NET_WARN_ON_ONCE(in_hardirq());
> > >>> -             skb->destructor(skb);
> > >>> +#ifdef CONFIG_INET
> > >>> +             INDIRECT_CALL_3(skb->destructor,
> > >>> +                             tcp_wfree, __sock_wfree, sock_wfree,
> > >>> +                             skb);
> > >>> +#else
> > >>> +             INDIRECT_CALL_1(skb->destructor,
> > >>> +                             sock_wfree,
> > >>> +                             skb);
> > >>> +
> > >>> +#endif
> > >>
> > >> Is it just me or seems like you ignored the suggestion/discussion under
> > >> v1 of this patch...
> > >>
> > >
> > > I did not. Please send a patch when you can demonstrate the difference.
> >
> > You "did not", but you didn't reply there, only sent v2 w/o any mention.
> >
> > >
> > > We are not going to add all the possible destructors unless there is evidence.
> >
> > There are numbers in the original discussion, you'd have noticed if you
> > did read.
> >
> > We only ask to add one more destructor which will help certain
> > perf-critical workloads. Add it to the end of the list, so that it won't
> > hurt your optimization.
> >
> > "Send a patch" means you're now changing these lines now and then they
> > would be changed once again, why...
>
> I can not test what you propose.
>
> I can drop this patch instead, and keep it in Google kernels, (we had
> TCP support for years)
>
> Or... you can send a patch on top of it later.
>

Sorry, I've been away from the keyboard for a few days. I think it's
fair to let us (who are currently working on the xsk improvement) post
a simple patch based on the series.

Regarding what you mentioned that 1% is a noisy number, I disagree.
The overall numbers are improved, rather than only one or small part
of them. I've done a few tests under different servers, so I believe
what I've seen. BTW, xdpsock is the test tool that gives a stable
number especially when running on the physical machine.

@ Alexander I think I can post that patch with more test numbers and
your 'suggested-by' tag included if you have no objection:) Or if you
wish you could do it on your own, please feel free to send one then :)

Thanks,
Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ