]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: make cwnd-limited checks measurement-based, and gentler
authorNeal Cardwell <ncardwell@google.com>
Thu, 22 May 2014 14:41:08 +0000 (10:41 -0400)
committerDavid S. Miller <davem@davemloft.net>
Thu, 22 May 2014 16:04:49 +0000 (12:04 -0400)
commit52a1301f5152457dbc169cdf6899aa595d78cc82
tree5b5c47c2298af095e33ae1a5fd9f6192e13b56e3
parenta0821a4f69d2ad0221cb548236add9952107950b
tcp: make cwnd-limited checks measurement-based, and gentler

Experience with the recent d2797bfd13f0 ("tcp: fix cwnd limited
checking to improve congestion control") has shown that there are
common cases where that commit can cause cwnd to be much larger than
necessary. This leads to TSO autosizing cooking skbs that are too
large, among other things.

The main problems seemed to be:

(1) That commit attempted to predict the future behavior of the
connection by looking at the write queue (if TSO or TSQ limit
sending). That prediction sometimes overestimated future outstanding
packets.

(2) That commit always allowed cwnd to grow to twice the number of
outstanding packets (even in congestion avoidance, where this is not
needed).

This commit improves both of these, by:

(1) Switching to a measurement-based approach where we explicitly
track the largest number of packets in flight during the past window
("max_packets_out"), and remember whether we were cwnd-limited at the
moment we finished sending that flight.

(2) Only allowing cwnd to grow to twice the number of outstanding
packets ("max_packets_out") in slow start. In congestion avoidance
mode we now only allow cwnd to grow if it was fully utilized.

Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/tcp.h
include/net/tcp.h
net/ipv4/tcp_output.c