aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/backport-4.9/024-5-tcp-tsq-add-a-shortcut-in-tcp_small_queue_check.patch
diff options
context:
space:
mode:
authorPavel Kubelun <be.dissent@gmail.com>2017-07-25 03:57:31 -0400
committerStijn Tintel <stijn@linux-ipv6.be>2017-10-08 15:19:07 +0300
commitb2ea46fe236ae02d845f94cf984cbc1786870333 (patch)
tree277ff9cd154420367c261324e69ba831e3c762b7 /target/linux/generic/backport-4.9/024-5-tcp-tsq-add-a-shortcut-in-tcp_small_queue_check.patch
parent3a69ad3b2a0df578ca340ba95f35230ee9529c9c (diff)
downloadupstream-b2ea46fe236ae02d845f94cf984cbc1786870333.tar.gz
upstream-b2ea46fe236ae02d845f94cf984cbc1786870333.tar.bz2
upstream-b2ea46fe236ae02d845f94cf984cbc1786870333.zip
generic: net: tcp: backport tcp tx performance patches
An overall throughput gain of 22 % for heavy TCP use over a single TX queue. Original patchset comment https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v4.13&id=3f4888adae7c1619b990d98a9b967536f71822b8 Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
Diffstat (limited to 'target/linux/generic/backport-4.9/024-5-tcp-tsq-add-a-shortcut-in-tcp_small_queue_check.patch')
-rw-r--r--target/linux/generic/backport-4.9/024-5-tcp-tsq-add-a-shortcut-in-tcp_small_queue_check.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/target/linux/generic/backport-4.9/024-5-tcp-tsq-add-a-shortcut-in-tcp_small_queue_check.patch b/target/linux/generic/backport-4.9/024-5-tcp-tsq-add-a-shortcut-in-tcp_small_queue_check.patch
new file mode 100644
index 0000000000..dd1a37eb21
--- /dev/null
+++ b/target/linux/generic/backport-4.9/024-5-tcp-tsq-add-a-shortcut-in-tcp_small_queue_check.patch
@@ -0,0 +1,37 @@
+From 75eefc6c59fd2c5f1ab95a3a113c217237d12a31 Mon Sep 17 00:00:00 2001
+From: Eric Dumazet <edumazet@google.com>
+Date: Sat, 3 Dec 2016 11:14:54 -0800
+Subject: [PATCH 05/10] tcp: tsq: add a shortcut in tcp_small_queue_check()
+
+Always allow the two first skbs in write queue to be sent,
+regardless of sk_wmem_alloc/sk_pacing_rate values.
+
+This helps a lot in situations where TX completions are delayed either
+because of driver latencies or softirq latencies.
+
+Test is done with no cache line misses.
+
+Signed-off-by: Eric Dumazet <edumazet@google.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ net/ipv4/tcp_output.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+--- a/net/ipv4/tcp_output.c
++++ b/net/ipv4/tcp_output.c
+@@ -2084,6 +2084,15 @@ static bool tcp_small_queue_check(struct
+ limit <<= factor;
+
+ if (atomic_read(&sk->sk_wmem_alloc) > limit) {
++ /* Always send the 1st or 2nd skb in write queue.
++ * No need to wait for TX completion to call us back,
++ * after softirq/tasklet schedule.
++ * This helps when TX completions are delayed too much.
++ */
++ if (skb == sk->sk_write_queue.next ||
++ skb->prev == sk->sk_write_queue.next)
++ return false;
++
+ set_bit(TSQ_THROTTLED, &tcp_sk(sk)->tsq_flags);
+ /* It is possible TX completion already happened
+ * before we set TSQ_THROTTLED, so we must