net: deal with sticky tx queues
Subsystems (5)
cover net: deal with sticky tx queues
Back in 2010, Tom Herbert added skb->ooo_okay to TCP flows.
Extend the feature to connected flows for other protocols like UDP.
skb->ooo_okay might never be set for bulk flows that always have at least one skb in a qdisc queue of NIC queue, especially if TX completion is delayed because of a stressed cpu or aggressive interrupt mitigation.
The so-called "strange attractors" has caused many performance issues, we need to do better now that TCP reacts better to potential reorders.
Add new net.core.txq_reselection_ms sysctl to let flows follow XPS and select a more efficient queue.
After this series, we no longer have to make sure threads are pinned to cpus, they can migrate without adding too much [spinlock, qdisc, TX completion] pressure anymore.
Eric Dumazet (4):
net: add SK_WMEM_ALLOC_BIAS constant
net: control skb->ooo_okay from skb_set_owner_w()
net: add /proc/sys/net/core/txq_reselection_ms control
net: allow busy connected flows to switch tx queues
Documentation/admin-guide/sysctl/net.rst | 17 ++++++++++++++ include/net/netns/core.h | 1 + include/net/sock.h | 29 ++++++++++++------------ net/atm/common.c | 2 +- net/core/dev.c | 29 ++++++++++++++++++++++-- net/core/net_namespace.c | 1 + net/core/sock.c | 17 ++++++++++---- net/core/sysctl_net_core.c | 7 ++++++ 8 files changed, 81 insertions(+), 22 deletions(-)
Signature · 1 line
2.51.0.740.g6adb054d12-goog
PATCH 1/4 net: add SK_WMEM_ALLOC_BIAS constant
sk->sk_wmem_alloc is initialized to 1, and sk_wmem_alloc_get() takes care of this initial value.
Add SK_WMEM_ALLOC_BIAS define to not spread this magic value.
--- include/net/sock.h | 3 ++- net/atm/common.c | 2 +- net/core/sock.c | 5 ++--- 3 files changed, 5 insertions(+), 5 deletions(-)
include/net/sock.h +2 -1
@@ -2303,6 +2303,7 @@ static inline int skb_copy_to_page_nocache(struct sock *sk, struct iov_iter *froreturn 0 ; } +#define SK_WMEM_ALLOC_BIAS 1/** * sk_wmem_alloc_get - returns write allocations * @sk: socket
@@ -2311,7 +2312,7 @@ static inline int skb_copy_to_page_nocache(struct sock *sk, struct iov_iter *fro*/ static inline int sk_wmem_alloc_get (const struct sock *sk) { -return refcount_read (&sk->sk_wmem_alloc) -1 ; +return refcount_read (&sk->sk_wmem_alloc) -SK_WMEM_ALLOC_BIAS ; }/**
net/atm/common.c +1 -1
@@ -157,7 +157,7 @@ int vcc_create(struct net *net, struct socket *sock, int protocol, int family, imemset (&vcc->local,0 ,sizeof (struct sockaddr_atmsvc ));memset (&vcc->remote,0 ,sizeof (struct sockaddr_atmsvc )); vcc->qos.txtp.max_sdu =1 <<16 ;/* for meta VCs */ -refcount_set (&sk->sk_wmem_alloc,1 ); +refcount_set (&sk->sk_wmem_alloc,SK_WMEM_ALLOC_BIAS );atomic_set (&sk->sk_rmem_alloc,0 ); vcc->push =NULL ; vcc->pop =NULL ;
net/core/sock.c +2 -3
@@ -2313,7 +2313,7 @@ struct sock *sk_alloc(struct net *net, int family, gfp_t priority, }sock_net_set (sk, net); -refcount_set (&sk->sk_wmem_alloc,1 ); +refcount_set (&sk->sk_wmem_alloc,SK_WMEM_ALLOC_BIAS );mem_cgroup_sk_alloc (sk);cgroup_sk_alloc (&sk->sk_cgrp_data);
@@ -2494,8 +2494,7 @@ struct sock *sk_clone_lock(const struct sock *sk, const gfp_t priority)atomic_set (&newsk->sk_rmem_alloc,0 ); -/* sk_wmem_alloc set to one (see sk_free() and sock_wfree()) */ -refcount_set (&newsk->sk_wmem_alloc,1 ); +refcount_set (&newsk->sk_wmem_alloc,SK_WMEM_ALLOC_BIAS );atomic_set (&newsk->sk_omem_alloc,0 );sk_init_common (newsk);
Signature · 1 line
2.51.0.740.g6adb054d12-goog
Re: [PATCH v1 net-next 1/4] net: add SK_WMEM_ALLOC_BIAS constant
Quoted 8 lines · Eric Dumazet
sk->sk_wmem_allocis initialized to 1, andsk_wmem_alloc_get()takes care of this initial value.Add
SK_WMEM_ALLOC_BIASdefine to not spread this magic value.Signed-off-by Eric Dumazet <[email protected]>Reviewed-by Neal Cardwell <[email protected]>
PATCH 2/4 net: control skb->ooo_okay from skb_set_owner_w()
In reply to Eric Dumazet15 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, 512 cpus, 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 | |
--- net/core/sock.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
net/core/sock.c +11 -1
@@ -2694,6 +2694,8 @@ void __sock_wfree(struct sk_buff *skb)void skb_set_owner_w (struct sk_buff *skb,struct sock *sk) { +int old_wmem; +skb_orphan (skb);#ifdef CONFIG_INET if (unlikely (!sk_fullsock (sk)))
@@ -2707,7 +2709,15 @@ void skb_set_owner_w(struct sk_buff *skb, struct sock *sk)* is enough to guarantee sk_free() won't free this sock until * all in-flight packets are completed */ -refcount_add (skb->truesize, &sk->sk_wmem_alloc); +__refcount_add (skb->truesize, &sk->sk_wmem_alloc, &old_wmem); + +/* (old_wmem == SK_WMEM_ALLOC_BIAS) if no other TX packet for this socket +* is in a host queue (qdisc, NIC queue). +* Set skb->ooo_okay so that netdev_pick_tx() can choose a TX queue +* based on XPS for better performance. +* Otherwise clear ooo_okay to not risk Out Of Order delivery. +*/ + skb->ooo_okay = (old_wmem ==SK_WMEM_ALLOC_BIAS ); }EXPORT_SYMBOL (skb_set_owner_w);
Signature · 1 line
2.51.0.740.g6adb054d12-goog
Re: [PATCH v1 net-next 2/4] net: control skb->ooo_okay from skb_set_owner_w()
Quoted 62 lines · Eric Dumazet
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 concurrentUDP_RRconnected UDP flows, host with 32 TX queues, 512 cpus, XPS setup.
super_netperf500 -tUDP_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 | |
Quoted 2 lines
Signed-off-by Eric Dumazet <[email protected]>Reviewed-by Neal Cardwell <[email protected]>
PATCH 3/4 net: add /proc/sys/net/core/txq_reselection_ms control
In reply to Eric DumazetAdd a new sysctl to control how often a queue reselection can happen even if a flow has a persistent queue of skbs in a Qdisc or NIC queue.
A value of zero means the feature is disabled.
Default is 1000 (1 second).
This sysctl is used in the following patch.
--- Documentation/admin-guide/sysctl/net.rst | 17 +++++++++++++++++ include/net/netns/core.h | 1 + net/core/net_namespace.c | 1 + net/core/sysctl_net_core.c | 7 +++++++ 4 files changed, 26 insertions(+)
Documentation/admin-guide/sysctl/net.rst +17 -0
@@ -406,6 +406,23 @@ to SOCK_TXREHASH_DEFAULT (i. e. not overridden by setsockopt). If set to 1 (default), hash rethink is performed on listening socket. If set to 0, hash rethink is not performed. +txq_reselection_ms +------------------ + +Controls how often (in ms) a busy connected flow can select another tx queue. + +A resection is desirable when/if user thread has migrated and XPS +would select a different queue. Same can occur without XPS +if the flow hash has changed. + +But switching txq can introduce reorders, especially if the +old queue is under high pressure. Modern TCP stacks deal +well with reorders if they happen not too often. + +To disable this feature, set the value to 0. + +Default : 1000 + gro_normal_batch ----------------
include/net/netns/core.h +1 -0
@@ -13,6 +13,7 @@ struct netns_core {struct ctl_table_header *sysctl_hdr;int sysctl_somaxconn; +int sysctl_txq_reselection;int sysctl_optmem_max;u8 sysctl_txrehash;u8 sysctl_tstamp_allow_data;
net/core/net_namespace.c +1 -0
@@ -395,6 +395,7 @@ static __net_init void preinit_net_sysctl(struct net *net) net->core.sysctl_optmem_max =128 *1024 ; net->core.sysctl_txrehash =SOCK_TXREHASH_ENABLED ; net->core.sysctl_tstamp_allow_data =1 ; + net->core.sysctl_txq_reselection =msecs_to_jiffies (1000 ); }/* init code that must occur even if setup_net() is not called. */
net/core/sysctl_net_core.c +7 -0
@@ -667,6 +667,13 @@ static struct ctl_table netns_core_table[] = { .extra2 = SYSCTL_ONE, .proc_handler = proc_dou8vec_minmax, }, + { + .procname = "txq_reselection_ms", + .data = &init_net.core.sysctl_txq_reselection, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = proc_dointvec_ms_jiffies, + }, { .procname = "tstamp_allow_data", .data = &init_net.core.sysctl_tstamp_allow_data,
Signature · 1 line
2.51.0.740.g6adb054d12-goog
Re: [PATCH v1 net-next 3/4] net: add /proc/sys/net/core/txq_reselection_ms control
Quoted 5 lines · Eric Dumazet
Add a new sysctl to control how often a queue reselection can happen even if a flow has a persistent queue of skbs in a Qdisc or NIC queue.
Quoted 8 lines
A value of zero means the feature is disabled.
Default is 1000 (1 second).
This sysctl is used in the following patch.
Signed-off-by Eric Dumazet <[email protected]>Reviewed-by Neal Cardwell <[email protected]>
PATCH 4/4 net: allow busy connected flows to switch tx queues
In reply to Eric DumazetThis is a followup of commit 726e9e8b94b9 ("tcp: refine skb->ooo_okay setting") and of prior commit in this series ("net: control skb->ooo_okay from skb_set_owner_w()")
skb->ooo_okay might never be set for bulk flows that always have at least one skb in a qdisc queue of NIC queue, especially if TX completion is delayed because of a stressed cpu.
The so-called "strange attractors" has caused many performance issues (see for instance 9b462d02d6dd ("tcp: TCP Small Queues and strange attractors")), we need to do better.
We have tried very hard to avoid reorders because TCP was not dealing with them nicely a decade ago.
Use the new net.core.txq_reselection_ms sysctl to let flows follow XPS and select a more efficient queue.
After this patch, we no longer have to make sure threads are pinned to cpus, they now can be migrated without adding too much spinlock/qdisc/TX completion pressure anymore.
TX completion part was problematic, because it added false sharing on various socket fields, but also added false sharing and spinlock contention in mm layers. Calling skb_orphan() from ndo_start_xmit() is not an option unfortunately.
Note for later:
1) move sk->sk_tx_queue_mapping closer
to sk_tx_queue_mapping_jiffies for better cache locality.
2) Study if 9b462d02d6dd ("tcp: TCP Small Queues
and strange attractors") could be revised.
Tested:
Used a host with 32 TX queues, shared by groups of 8 cores. XPS setup :
echo ff >/sys/class/net/eth1/queue/tx-0/xps_cpus
echo ff00 >/sys/class/net/eth1/queue/tx-1/xps_cpus echo ff0000 >/sys/class/net/eth1/queue/tx-2/xps_cpus echo ff000000 >/sys/class/net/eth1/queue/tx-3/xps_cpus echo ff,00000000 >/sys/class/net/eth1/queue/tx-4/xps_cpus echo ff00,00000000 >/sys/class/net/eth1/queue/tx-5/xps_cpus echo ff0000,00000000 >/sys/class/net/eth1/queue/tx-6/xps_cpus echo ff000000,00000000 >/sys/class/net/eth1/queue/tx-7/xps_cpus
...
Launched a tcp_stream with 15 threads and 1000 flows, initially affined to core 0-15
taskset -c 0-15 tcp_stream -T15 -F1000 -l1000 -c -H target_host
Checked that only queues 0 and 1 are used as instructed by XPS :
tc -s qdisc show dev eth1|grep backlog|grep -v "backlog 0b 0p"
backlog 123489410b 1890p
backlog 69809026b 1064p
backlog 52401054b 805p
Then force each thread to run on cpu 1,9,17,25,33,41,49,57,65,73,81,89,97,105,113,121
C=1;PID=pidof tcp_stream;for P in ls /proc/$PID/task; do taskset -pc $C $P; C=$(($C + 8));done
Set txq_reselection_ms to 1000
echo 1000 > /proc/sys/net/core/txq_reselection_ms
Check that the flows have migrated nicely:
tc -s qdisc show dev eth1|grep backlog|grep -v "backlog 0b 0p"
backlog 130508314b 1916p
backlog 8584380b 126p
backlog 8584380b 126p
backlog 8379990b 123p
backlog 8584380b 126p
backlog 8487484b 125p
backlog 8584380b 126p
backlog 8448120b 124p
backlog 8584380b 126p
backlog 8720640b 128p
backlog 8856900b 130p
backlog 8584380b 126p
backlog 8652510b 127p
backlog 8448120b 124p
backlog 8516250b 125p
backlog 7834950b 115p
--- include/net/sock.h | 26 ++++++++++++-------------- net/core/dev.c | 29 +++++++++++++++++++++++++++-- 2 files changed, 39 insertions(+), 16 deletions(-)
include/net/sock.h +12 -14
@@ -313,6 +313,7 @@ struct sk_filter;* @sk_bind_phc: SO_TIMESTAMPING bind PHC index of PTP virtual clock * for timestamping * @sk_tskey: counter to disambiguate concurrent tstamp requests +* @sk_tx_queue_mapping_jiffies: time in jiffies of last @sk_tx_queue_mapping refresh. * @sk_zckey: counter to order MSG_ZEROCOPY notifications * @sk_socket: Identd and reporting IO signals * @sk_user_data: RPC layer private data. Write-protected by @sk_callback_lock.
@@ -485,6 +486,7 @@ struct sock {unsigned long sk_pacing_rate;/* bytes per second */ atomic_t sk_zckey;atomic_t sk_tskey; +unsigned long sk_tx_queue_mapping_jiffies;__cacheline_group_end (sock_write_tx);__cacheline_group_begin (sock_read_tx);
@@ -1992,7 +1994,15 @@ static inline void sk_tx_queue_set(struct sock *sk, int tx_queue)/* Paired with READ_ONCE() in sk_tx_queue_get() and * other WRITE_ONCE() because socket lock might be not held. */ -WRITE_ONCE (sk->sk_tx_queue_mapping, tx_queue); +if (READ_ONCE (sk->sk_tx_queue_mapping) != tx_queue) { +WRITE_ONCE (sk->sk_tx_queue_mapping, tx_queue); +WRITE_ONCE (sk->sk_tx_queue_mapping_jiffies, jiffies); +return ; + } + +/* Refresh sk_tx_queue_mapping_jiffies if too old. */ +if (time_is_before_jiffies (READ_ONCE (sk->sk_tx_queue_mapping_jiffies) +HZ )) +WRITE_ONCE (sk->sk_tx_queue_mapping_jiffies, jiffies); }#define NO_QUEUE_MAPPING USHRT_MAX
@@ -2005,19 +2015,7 @@ static inline void sk_tx_queue_clear(struct sock *sk)WRITE_ONCE (sk->sk_tx_queue_mapping,NO_QUEUE_MAPPING ); } -static inline int sk_tx_queue_get (const struct sock *sk) -{ -if (sk) { -/* Paired with WRITE_ONCE() in sk_tx_queue_clear() -* and sk_tx_queue_set(). -*/ -int val =READ_ONCE (sk->sk_tx_queue_mapping); - -if (val !=NO_QUEUE_MAPPING ) -return val; - } -return -1 ; -} +int sk_tx_queue_get (const struct sock *sk); static inline void __sk_rx_queue_set(struct sock *sk, const struct sk_buff *skb,
net/core/dev.c +27 -2
@@ -4591,6 +4591,32 @@ u16 dev_pick_tx_zero(struct net_device *dev, struct sk_buff *skb, }EXPORT_SYMBOL (dev_pick_tx_zero); +int sk_tx_queue_get (const struct sock *sk) +{ +int resel, val; + +if (!sk) +return -1 ; +/* Paired with WRITE_ONCE() in sk_tx_queue_clear() +* and sk_tx_queue_set(). +*/ + val =READ_ONCE (sk->sk_tx_queue_mapping); + +if (val ==NO_QUEUE_MAPPING ) +return -1 ; + +if (!sk_fullsock (sk)) +return val; + + resel =READ_ONCE (sock_net (sk)->core.sysctl_txq_reselection); +if (resel &&time_is_before_jiffies ( +READ_ONCE (sk->sk_tx_queue_mapping_jiffies) + resel)) +return -1 ; + +return val; +} +EXPORT_SYMBOL (sk_tx_queue_get); +u16 netdev_pick_tx (struct net_device *dev,struct sk_buff *skb,struct net_device *sb_dev) {
@@ -4606,8 +4632,7 @@ u16 netdev_pick_tx(struct net_device *dev, struct sk_buff *skb,if (new_index <0 ) new_index =skb_tx_hash (dev, sb_dev, skb); -if (queue_index != new_index && sk && -sk_fullsock (sk) && +if (sk &&sk_fullsock (sk) &&rcu_access_pointer (sk->sk_dst_cache))sk_tx_queue_set (sk, new_index);
Signature · 1 line
2.51.0.740.g6adb054d12-goog
Re: [PATCH v1 net-next 4/4] net: allow busy connected flows to switch tx queues
Quoted 88 lines · Eric Dumazet
This is a followup of commit
726e9e8b94b9("tcp: refineskb->ooo_okaysetting") and of prior commit in this series ("net: controlskb->ooo_okayfromskb_set_owner_w()")
skb->ooo_okaymight never be set for bulk flows that always have at least one skb in a qdisc queue of NIC queue, especially if TX completion is delayed because of a stressed cpu.The so-called "strange attractors" has caused many performance issues (see for instance
9b462d02d6dd("tcp: TCP Small Queues and strange attractors")), we need to do better.We have tried very hard to avoid reorders because TCP was not dealing with them nicely a decade ago.
Use the new net.core.txq_reselection_ms sysctl to let flows follow XPS and select a more efficient queue.
After this patch, we no longer have to make sure threads are pinned to cpus, they now can be migrated without adding too much spinlock/qdisc/TX completion pressure anymore.
TX completion part was problematic, because it added false sharing on various socket fields, but also added false sharing and spinlock contention in mm layers. Calling
skb_orphan()fromndo_start_xmit()is not an option unfortunately.Note for later:
1) move
sk->sk_tx_queue_mappingcloser
tosk_tx_queue_mapping_jiffiesfor better cache locality.2) Study if
9b462d02d6dd("tcp: TCP Small Queues
and strange attractors") could be revised.Tested:
Used a host with 32 TX queues, shared by groups of 8 cores. XPS setup :
echo ff >/sys/class/net/eth1/queue/tx-0/xps_cpus
echo ff00 >/sys/class/net/eth1/queue/tx-1/xps_cpus echo ff0000 >/sys/class/net/eth1/queue/tx-2/xps_cpus echoff000000>/sys/class/net/eth1/queue/tx-3/xps_cpus echo ff,00000000 >/sys/class/net/eth1/queue/tx-4/xps_cpus echo ff00,00000000 >/sys/class/net/eth1/queue/tx-5/xps_cpus echo ff0000,00000000 >/sys/class/net/eth1/queue/tx-6/xps_cpus echo ff000000,00000000 >/sys/class/net/eth1/queue/tx-7/xps_cpus
...Launched a
tcp_streamwith 15 threads and 1000 flows, initially affined to core 0-15taskset -c 0-15
tcp_stream-T15 -F1000 -l1000 -c -Htarget_hostChecked that only queues 0 and 1 are used as instructed by XPS :
tc -s qdisc show dev eth1|grep backlog|grep -v "backlog 0b 0p"
backlog123489410b1890p
backlog69809026b1064p
backlog52401054b805pThen force each thread to run on cpu 1,9,17,25,33,41,49,57,65,73,81,89,97,105,113,121
C=1;PID=
pidof tcp_stream;for P inls /proc/$PID/task; do taskset -pc $C $P; C=$(($C + 8));doneSet
txq_reselection_msto 1000
echo 1000 >/proc/sys/net/core/txq_reselection_msCheck that the flows have migrated nicely:
tc -s qdisc show dev eth1|grep backlog|grep -v "backlog 0b 0p"
backlog130508314b1916p
backlog8584380b126p
backlog8584380b126p
backlog8379990b123p
backlog8584380b126p
backlog8487484b125p
backlog8584380b126p
backlog8448120b124p
backlog8584380b126p
backlog8720640b128p
backlog8856900b130p
backlog8584380b126p
backlog8652510b127p
backlog8448120b124p
backlog8516250b125p
backlog7834950b115p
Quoted 1 line
Signed-off-by Eric Dumazet <[email protected]>
Interesting change and changelog! thanks!
This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 10 lines · On Mon, 13 Oct 2025 15:22:30 +0000 you wrote:
Back in 2010, Tom Herbert added
skb->ooo_okayto TCP flows.Extend the feature to connected flows for other protocols like UDP.
skb->ooo_okaymight never be set for bulk flows that always have at least one skb in a qdisc queue of NIC queue, especially if TX completion is delayed because of a stressed cpu or aggressive interrupt mitigation.[...]
Here is the summary with links:
- [v1,net-next,1/4] net: add SK_WMEM_ALLOC_BIAS constant
https://git.kernel.org/netdev/net-next/c/6ddb811a579f - [v1,net-next,2/4] net: control skb->ooo_okay from skb_set_owner_w() https://git.kernel.org/netdev/net-next/c/d365c9bca35c - [v1,net-next,3/4] net: add /proc/sys/net/core/txq_reselection_ms control https://git.kernel.org/netdev/net-next/c/2ddef3462b3a - [v1,net-next,4/4] net: allow busy connected flows to switch tx queues https://git.kernel.org/netdev/net-next/c/4a7708443dec
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html