From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
To: Alexander Lobakin <aleksander.lobakin@intel.com>
Cc: Eric Dumazet <edumazet@google.com>,
"David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
Jamal Hadi Salim <jhs@mojatatu.com>,
Cong Wang <xiyou.wangcong@gmail.com>,
Jiri Pirko <jiri@resnulli.us>,
Kuniyuki Iwashima <kuniyu@google.com>,
Willem de Bruijn <willemb@google.com>, <netdev@vger.kernel.org>,
<eric.dumazet@gmail.com>
Subject: Re: [PATCH RFC net-next 1/5] net: add add indirect call wrapper in skb_release_head_state()
Date: Tue, 7 Oct 2025 21:41:43 +0200 [thread overview]
Message-ID: <aOVs9yvrwkH0dCDJ@boxer> (raw)
In-Reply-To: <4e997355-1c76-429b-b67f-2c543fd0853a@intel.com>
On Tue, Oct 07, 2025 at 05:26:46PM +0200, Alexander Lobakin wrote:
> From: Eric Dumazet <edumazet@google.com>
> Date: Mon, 6 Oct 2025 19:30:59 +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@google.com>
> > ---
> > net/core/skbuff.c | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> > index bc12790017b0b5c0be99f8fb9d362b3730fa4eb0..c9c06f9a8d6085f8d0907b412e050a60c835a6e8 100644
> > --- a/net/core/skbuff.c
> > +++ b/net/core/skbuff.c
> > @@ -1136,7 +1136,9 @@ 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);
> > + INDIRECT_CALL_3(skb->destructor,
> > + tcp_wfree, __sock_wfree, sock_wfree,
> > + skb);
>
> Not sure, but maybe we could add generic XSk skb destructor here as
> well? Or it's not that important as generic XSk is not the best way to
> use XDP sockets?
>
> Maciej, what do you think?
I would appreciate it as there has been various attempts to optmize xsk
generic xmit path.
>
> > }
> > #if IS_ENABLED(CONFIG_NF_CONNTRACK)
> > nf_conntrack_put(skb_nfct(skb));
>
> Thanks,
> Olek
next prev parent reply other threads:[~2025-10-07 19:41 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-06 19:30 [PATCH RFC net-next 0/5] net: optimize TX throughput and efficiency Eric Dumazet
2025-10-06 19:30 ` [PATCH RFC net-next 1/5] net: add add indirect call wrapper in skb_release_head_state() Eric Dumazet
2025-10-06 19:38 ` Eric Dumazet
2025-10-07 15:26 ` Alexander Lobakin
2025-10-07 19:41 ` Maciej Fijalkowski [this message]
2025-10-09 8:37 ` Jason Xing
2025-10-06 19:31 ` [PATCH RFC net-next 2/5] net/sched: act_mirred: add loop detection Eric Dumazet
2025-10-12 15:22 ` Jamal Hadi Salim
2025-10-12 18:34 ` Eric Dumazet
2025-10-06 19:31 ` [PATCH RFC net-next 3/5] Revert "net/sched: Fix mirred deadlock on device recursion" Eric Dumazet
2025-10-06 19:31 ` [PATCH RFC net-next 4/5] net: sched: claim one cache line in Qdisc Eric Dumazet
2025-10-06 19:31 ` [PATCH RFC net-next 5/5] net: dev_queue_xmit() llist adoption Eric Dumazet
2025-10-07 11:37 ` Eric Dumazet
2025-10-08 6:37 ` Paolo Abeni
2025-10-08 7:32 ` Eric Dumazet
2025-10-08 7:44 ` Paolo Abeni
2025-10-08 8:48 ` Toke Høiland-Jørgensen
2025-10-08 9:32 ` Eric Dumazet
2025-10-08 10:05 ` Toke Høiland-Jørgensen
2025-10-08 10:46 ` Eric Dumazet
2025-10-08 12:11 ` Toke Høiland-Jørgensen
2025-10-07 5:23 ` [syzbot ci] Re: net: optimize TX throughput and efficiency syzbot ci
2025-10-07 7:41 ` Eric Dumazet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aOVs9yvrwkH0dCDJ@boxer \
--to=maciej.fijalkowski@intel.com \
--cc=aleksander.lobakin@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eric.dumazet@gmail.com \
--cc=horms@kernel.org \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=willemb@google.com \
--cc=xiyou.wangcong@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).