aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_output.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2018-11-11 09:41:31 -0500
committerDavid S. Miller <davem@davemloft.net>2018-11-11 16:54:53 -0500
commita682850a114aef947da5d603f7fd2cfe7eabbd72 (patch)
tree1ba9698d64af24b2567bcd2d6cc590fb140ec386 /net/ipv4/tcp_output.c
parentf1c6ea3827b5e5ec62e297bcf4ccfd065326e8f7 (diff)
tcp: get rid of tcp_tso_should_defer() dependency on HZ/jiffies
tcp_tso_should_defer() first heuristic is to not defer if last send is "old enough". Its current implementation uses jiffies and its low granularity. TSO autodefer performance should not rely on kernel HZ :/ After EDT conversion, we have state variables in nanoseconds that can allow us to properly implement the heuristic. This patch increases TSO chunk sizes on medium rate flows, especially when receivers do not use GRO or similar aggregation. It also reduces bursts for HZ=100 or HZ=250 kernels, making TCP behavior more uniform. Signed-off-by: Eric Dumazet <edumazet@google.com> Acked-by: Soheil Hassas Yeganeh <soheil@google.com> Acked-by: Neal Cardwell <ncardwell@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_output.c')
-rw-r--r--net/ipv4/tcp_output.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 78a56cef7e39..75dcf4daca72 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -1920,9 +1920,12 @@ static bool tcp_tso_should_defer(struct sock *sk, struct sk_buff *skb,
1920 goto send_now; 1920 goto send_now;
1921 1921
1922 /* Avoid bursty behavior by allowing defer 1922 /* Avoid bursty behavior by allowing defer
1923 * only if the last write was recent. 1923 * only if the last write was recent (1 ms).
1924 * Note that tp->tcp_wstamp_ns can be in the future if we have
1925 * packets waiting in a qdisc or device for EDT delivery.
1924 */ 1926 */
1925 if ((s32)(tcp_jiffies32 - tp->lsndtime) > 0) 1927 delta = tp->tcp_clock_cache - tp->tcp_wstamp_ns - NSEC_PER_MSEC;
1928 if (delta > 0)
1926 goto send_now; 1929 goto send_now;
1927 1930
1928 in_flight = tcp_packets_in_flight(tp); 1931 in_flight = tcp_packets_in_flight(tp);