netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2 net-next] tcp: sk_add_backlog() is too agressive for TCP
@ 2012-04-23  9:38 Eric Dumazet
  2012-04-23 17:14 ` Rick Jones
  0 siblings, 1 reply; 37+ messages in thread
From: Eric Dumazet @ 2012-04-23  9:38 UTC (permalink / raw)
  To: David Miller
  Cc: netdev, Tom Herbert, Neal Cardwell, Maciej Żenczykowski,
	Yuchung Cheng, Ilpo Järvinen, Rick Jones

From: Eric Dumazet <edumazet@google.com>

While investigating TCP performance problems on 10Gb+ links, we found a
tcp sender was dropping lot of incoming ACKS because of sk_rcvbuf limit
in sk_add_backlog(), especially if receiver doesnt use GRO/LRO and sends
one ACK every two MSS segments.

A sender usually tweaks sk_sndbuf, but sk_rcvbuf stays at its default
value (87380), allowing a too small backlog.

A TCP ACK, even being small, can consume nearly same truesize space than
outgoing packets. Using sk_rcvbuf + sk_sndbuf as a limit makes sense and
is fast to compute.

Performance results on netperf, single flow, receiver with disabled
GRO/LRO : 7500 Mbits instead of 6050 Mbits, no more TCPBacklogDrop
increments at sender.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Neal Cardwell <ncardwell@google.com>
Cc: Tom Herbert <therbert@google.com>
Cc: Maciej Żenczykowski <maze@google.com>
Cc: Yuchung Cheng <ycheng@google.com>
Cc: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Cc: Rick Jones <rick.jones2@hp.com>
---
 net/ipv4/tcp_ipv4.c |    3 ++-
 net/ipv6/tcp_ipv6.c |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 917607e..cf97e98 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1752,7 +1752,8 @@ process:
 			if (!tcp_prequeue(sk, skb))
 				ret = tcp_v4_do_rcv(sk, skb);
 		}
-	} else if (unlikely(sk_add_backlog(sk, skb, sk->sk_rcvbuf))) {
+	} else if (unlikely(sk_add_backlog(sk, skb,
+					   sk->sk_rcvbuf + sk->sk_sndbuf))) {
 		bh_unlock_sock(sk);
 		NET_INC_STATS_BH(net, LINUX_MIB_TCPBACKLOGDROP);
 		goto discard_and_relse;
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index b04e6d8..5fb19d3 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -1654,7 +1654,8 @@ process:
 			if (!tcp_prequeue(sk, skb))
 				ret = tcp_v6_do_rcv(sk, skb);
 		}
-	} else if (unlikely(sk_add_backlog(sk, skb, sk->sk_rcvbuf))) {
+	} else if (unlikely(sk_add_backlog(sk, skb,
+					   sk->sk_rcvbuf + sk->sk_sndbuf))) {
 		bh_unlock_sock(sk);
 		NET_INC_STATS_BH(net, LINUX_MIB_TCPBACKLOGDROP);
 		goto discard_and_relse;

^ permalink raw reply related	[flat|nested] 37+ messages in thread

end of thread, other threads:[~2012-04-26 20:18 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-23  9:38 [PATCH 2/2 net-next] tcp: sk_add_backlog() is too agressive for TCP Eric Dumazet
2012-04-23 17:14 ` Rick Jones
2012-04-23 17:23   ` Eric Dumazet
2012-04-23 20:01     ` David Miller
2012-04-23 20:37       ` Eric Dumazet
2012-04-23 20:57         ` Rick Jones
2012-04-23 21:30           ` Eric Dumazet
2012-04-23 21:51             ` Rick Jones
2012-04-23 21:56               ` Rick Jones
2012-04-23 22:05               ` Eric Dumazet
2012-04-23 22:16                 ` Rick Jones
2012-04-24 15:25                   ` Christoph Lameter
2012-04-23 21:01         ` David Miller
2012-04-23 21:38           ` Eric Dumazet
2012-04-24  2:20         ` Eric Dumazet
2012-04-24  2:27           ` David Miller
2012-04-24  8:01           ` Ilpo Järvinen
2012-04-24  8:10             ` David Miller
2012-04-24  8:21               ` Ilpo Järvinen
2012-04-24  8:25                 ` David Miller
2012-04-24  8:40                   ` Ilpo Järvinen
2012-04-24  8:48                     ` David Miller
2012-04-24 10:32                       ` Ilpo Järvinen
2012-04-24  8:56                     ` Eric Dumazet
2012-04-26  8:10                       ` [RFC] allow skb->head to point/alias to first skb frag Eric Dumazet
2012-04-26  8:36                         ` David Miller
2012-04-26  9:10                           ` Eric Dumazet
2012-04-26  9:18                             ` David Miller
2012-04-26  9:22                               ` Eric Dumazet
2012-04-26 10:09                                 ` Maciej Żenczykowski
2012-04-26 12:32                                   ` Eric Dumazet
2012-04-26 13:50                                     ` Eric Dumazet
2012-04-26 20:12                                       ` David Miller
2012-04-26 20:18                                         ` Eric Dumazet
2012-04-24  8:49             ` [PATCH 2/2 net-next] tcp: sk_add_backlog() is too agressive for TCP Eric Dumazet
2012-04-24  8:44         ` David Laight
2012-04-24  8:53           ` Eric Dumazet

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).