netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Neal Cardwell <ncardwell@google.com>
To: Eric Dumazet <edumazet@google.com>
Cc: "David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	 Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
	 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 2/4] net: control skb->ooo_okay from skb_set_owner_w()
Date: Wed, 8 Oct 2025 10:26:45 -0400	[thread overview]
Message-ID: <CADVnQymCD-zpw_kN3TUaWZ3afsJUZd5JazGA28s1+siQzpBkpw@mail.gmail.com> (raw)
In-Reply-To: <20251008104612.1824200-3-edumazet@google.com>

On Wed, Oct 8, 2025 at 6:46 AM Eric Dumazet <edumazet@google.com> wrote:
>
> 15 years after Tom Herbert added skb->ooo_okay, only TCP transport
> benefits from it.
>
> We can support other transports directly from skb_set_owner_w().
>
> If no other TX packet for this socket is in a host queue (qdisc, NIC queue)
> there is no risk of self-inflicted reordering, we can set skb->ooo_okay.
>
> This allows netdev_pick_tx() to choose a TX queue based on XPS settings,
> instead of reusing the queue chosen at the time the first packet was sent
> for connected sockets.
>
> Tested:
>   500 concurrent UDP_RR connected UDP flows, host with 32 TX queues, XPS setup.
>
>   super_netperf 500 -t UDP_RR -H <host> -l 1000 -- -r 100,100 -Nn &
>
> This patch saves between 10% and 20% of cycles, depending on how
> process scheduler migrates threads among cpus.
>
> Using following bpftrace script, we can see the effect on Qdisc/NIC tx queues
> being better used (less cache line misses).
>
> bpftrace -e '
> k:__dev_queue_xmit { @start[cpu] = nsecs; }
> kr:__dev_queue_xmit {
>  if (@start[cpu]) {
>     $delay = nsecs - @start[cpu];
>     delete(@start[cpu]);
>     @__dev_queue_xmit_ns = hist($delay);
>  }
> }
> END { clear(@start); }'
>
> Before:
> @__dev_queue_xmit_ns:
> [128, 256)             6 |                                                    |
> [256, 512)        116283 |                                                    |
> [512, 1K)        1888205 |@@@@@@@@@@@                                         |
> [1K, 2K)         8106167 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@    |
> [2K, 4K)         8699293 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@|
> [4K, 8K)         2600676 |@@@@@@@@@@@@@@@                                     |
> [8K, 16K)         721688 |@@@@                                                |
> [16K, 32K)        122995 |                                                    |
> [32K, 64K)         10639 |                                                    |
> [64K, 128K)          119 |                                                    |
> [128K, 256K)           1 |                                                    |
>
> After:
> @__dev_queue_xmit_ns:
> [128, 256)             3 |                                                    |
> [256, 512)        651112 |@@                                                  |
> [512, 1K)        8109938 |@@@@@@@@@@@@@@@@@@@@@@@@@@                          |
> [1K, 2K)        16081031 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@|
> [2K, 4K)         2411692 |@@@@@@@                                             |
> [4K, 8K)           98994 |                                                    |
> [8K, 16K)           1536 |                                                    |
> [16K, 32K)           587 |                                                    |
> [32K, 64K)             2 |                                                    |
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> ---

Reviewed-by: Neal Cardwell <ncardwell@google.com>

Nice! Thanks!

neal

  reply	other threads:[~2025-10-08 14:27 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-08 10:46 [PATCH RFC net-next 0/4] net: deal with strange attractors tx queues Eric Dumazet
2025-10-08 10:46 ` [PATCH RFC net-next 1/4] net: add SK_WMEM_ALLOC_BIAS constant Eric Dumazet
2025-10-08 14:25   ` Neal Cardwell
2025-10-08 10:46 ` [PATCH RFC net-next 2/4] net: control skb->ooo_okay from skb_set_owner_w() Eric Dumazet
2025-10-08 14:26   ` Neal Cardwell [this message]
2025-10-08 10:46 ` [PATCH RFC net-next 3/4] net: add /proc/sys/net/core/txq_reselection_ms control Eric Dumazet
2025-10-08 14:27   ` Neal Cardwell
2025-10-08 15:21   ` Paolo Abeni
2025-10-08 15:25     ` Eric Dumazet
2025-10-08 10:46 ` [PATCH RFC net-next 4/4] net: allow busy connected flows to switch tx queues Eric Dumazet
2025-10-08 13:38   ` Willem de Bruijn
2025-10-08 14:38     ` Eric Dumazet
2025-10-08 15:30   ` Paolo Abeni
2025-10-08 16:30     ` Eric Dumazet
2025-10-13  9:18   ` Simon Horman
2025-10-13  9:33     ` 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=CADVnQymCD-zpw_kN3TUaWZ3afsJUZd5JazGA28s1+siQzpBkpw@mail.gmail.com \
    --to=ncardwell@google.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=willemb@google.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).