summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.18/0019-tcp-change-tcp_adv_win_scale-and-tcp_rmem-2.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.18/0019-tcp-change-tcp_adv_win_scale-and-tcp_rmem-2.patch')
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.18/0019-tcp-change-tcp_adv_win_scale-and-tcp_rmem-2.patch124
1 files changed, 124 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.18/0019-tcp-change-tcp_adv_win_scale-and-tcp_rmem-2.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.18/0019-tcp-change-tcp_adv_win_scale-and-tcp_rmem-2.patch
new file mode 100644
index 00000000..e0e1dda9
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.18/0019-tcp-change-tcp_adv_win_scale-and-tcp_rmem-2.patch
@@ -0,0 +1,124 @@
1From 98d841428279a8060b46cf13a1463ebbeca65b4a Mon Sep 17 00:00:00 2001
2From: Eric Dumazet <edumazet@google.com>
3Date: Wed, 2 May 2012 02:28:41 +0000
4Subject: [PATCH 19/56] tcp: change tcp_adv_win_scale and tcp_rmem[2]
5
6[ Upstream commit b49960a05e32121d29316cfdf653894b88ac9190 ]
7
8tcp_adv_win_scale default value is 2, meaning we expect a good citizen
9skb to have skb->len / skb->truesize ratio of 75% (3/4)
10
11In 2.6 kernels we (mis)accounted for typical MSS=1460 frame :
121536 + 64 + 256 = 1856 'estimated truesize', and 1856 * 3/4 = 1392.
13So these skbs were considered as not bloated.
14
15With recent truesize fixes, a typical MSS=1460 frame truesize is now the
16more precise :
172048 + 256 = 2304. But 2304 * 3/4 = 1728.
18So these skb are not good citizen anymore, because 1460 < 1728
19
20(GRO can escape this problem because it build skbs with a too low
21truesize.)
22
23This also means tcp advertises a too optimistic window for a given
24allocated rcvspace : When receiving frames, sk_rmem_alloc can hit
25sk_rcvbuf limit and we call tcp_prune_queue()/tcp_collapse() too often,
26especially when application is slow to drain its receive queue or in
27case of losses (netperf is fast, scp is slow). This is a major latency
28source.
29
30We should adjust the len/truesize ratio to 50% instead of 75%
31
32This patch :
33
341) changes tcp_adv_win_scale default to 1 instead of 2
35
362) increase tcp_rmem[2] limit from 4MB to 6MB to take into account
37better truesize tracking and to allow autotuning tcp receive window to
38reach same value than before. Note that same amount of kernel memory is
39consumed compared to 2.6 kernels.
40
41Signed-off-by: Eric Dumazet <edumazet@google.com>
42Cc: Neal Cardwell <ncardwell@google.com>
43Cc: Tom Herbert <therbert@google.com>
44Cc: Yuchung Cheng <ycheng@google.com>
45Acked-by: Neal Cardwell <ncardwell@google.com>
46Signed-off-by: David S. Miller <davem@davemloft.net>
47Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
48---
49 Documentation/networking/ip-sysctl.txt | 4 ++--
50 net/ipv4/tcp.c | 9 +++++----
51 net/ipv4/tcp_input.c | 2 +-
52 3 files changed, 8 insertions(+), 7 deletions(-)
53
54diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt
55index 589f2da..a4399f5 100644
56--- a/Documentation/networking/ip-sysctl.txt
57+++ b/Documentation/networking/ip-sysctl.txt
58@@ -137,7 +137,7 @@ tcp_adv_win_scale - INTEGER
59 (if tcp_adv_win_scale > 0) or bytes-bytes/2^(-tcp_adv_win_scale),
60 if it is <= 0.
61 Possible values are [-31, 31], inclusive.
62- Default: 2
63+ Default: 1
64
65 tcp_allowed_congestion_control - STRING
66 Show/set the congestion control choices available to non-privileged
67@@ -397,7 +397,7 @@ tcp_rmem - vector of 3 INTEGERs: min, default, max
68 net.core.rmem_max. Calling setsockopt() with SO_RCVBUF disables
69 automatic tuning of that socket's receive buffer size, in which
70 case this value is ignored.
71- Default: between 87380B and 4MB, depending on RAM size.
72+ Default: between 87380B and 6MB, depending on RAM size.
73
74 tcp_sack - BOOLEAN
75 Enable select acknowledgments (SACKS).
76diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
77index 7904db4..8f826b1 100644
78--- a/net/ipv4/tcp.c
79+++ b/net/ipv4/tcp.c
80@@ -3216,7 +3216,7 @@ void __init tcp_init(void)
81 {
82 struct sk_buff *skb = NULL;
83 unsigned long limit;
84- int i, max_share, cnt;
85+ int i, max_rshare, max_wshare, cnt;
86 unsigned long jiffy = jiffies;
87
88 BUILD_BUG_ON(sizeof(struct tcp_skb_cb) > sizeof(skb->cb));
89@@ -3280,15 +3280,16 @@ void __init tcp_init(void)
90
91 /* Set per-socket limits to no more than 1/128 the pressure threshold */
92 limit = ((unsigned long)sysctl_tcp_mem[1]) << (PAGE_SHIFT - 7);
93- max_share = min(4UL*1024*1024, limit);
94+ max_wshare = min(4UL*1024*1024, limit);
95+ max_rshare = min(6UL*1024*1024, limit);
96
97 sysctl_tcp_wmem[0] = SK_MEM_QUANTUM;
98 sysctl_tcp_wmem[1] = 16*1024;
99- sysctl_tcp_wmem[2] = max(64*1024, max_share);
100+ sysctl_tcp_wmem[2] = max(64*1024, max_wshare);
101
102 sysctl_tcp_rmem[0] = SK_MEM_QUANTUM;
103 sysctl_tcp_rmem[1] = 87380;
104- sysctl_tcp_rmem[2] = max(87380, max_share);
105+ sysctl_tcp_rmem[2] = max(87380, max_rshare);
106
107 printk(KERN_INFO "TCP: Hash tables configured "
108 "(established %u bind %u)\n",
109diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
110index db07c9e..9726927 100644
111--- a/net/ipv4/tcp_input.c
112+++ b/net/ipv4/tcp_input.c
113@@ -83,7 +83,7 @@ int sysctl_tcp_ecn __read_mostly = 2;
114 EXPORT_SYMBOL(sysctl_tcp_ecn);
115 int sysctl_tcp_dsack __read_mostly = 1;
116 int sysctl_tcp_app_win __read_mostly = 31;
117-int sysctl_tcp_adv_win_scale __read_mostly = 2;
118+int sysctl_tcp_adv_win_scale __read_mostly = 1;
119 EXPORT_SYMBOL(sysctl_tcp_adv_win_scale);
120
121 int sysctl_tcp_stdurg __read_mostly;
122--
1231.7.7.6
124