diff options
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.patch | 124 |
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 @@ | |||
1 | From 98d841428279a8060b46cf13a1463ebbeca65b4a Mon Sep 17 00:00:00 2001 | ||
2 | From: Eric Dumazet <edumazet@google.com> | ||
3 | Date: Wed, 2 May 2012 02:28:41 +0000 | ||
4 | Subject: [PATCH 19/56] tcp: change tcp_adv_win_scale and tcp_rmem[2] | ||
5 | |||
6 | [ Upstream commit b49960a05e32121d29316cfdf653894b88ac9190 ] | ||
7 | |||
8 | tcp_adv_win_scale default value is 2, meaning we expect a good citizen | ||
9 | skb to have skb->len / skb->truesize ratio of 75% (3/4) | ||
10 | |||
11 | In 2.6 kernels we (mis)accounted for typical MSS=1460 frame : | ||
12 | 1536 + 64 + 256 = 1856 'estimated truesize', and 1856 * 3/4 = 1392. | ||
13 | So these skbs were considered as not bloated. | ||
14 | |||
15 | With recent truesize fixes, a typical MSS=1460 frame truesize is now the | ||
16 | more precise : | ||
17 | 2048 + 256 = 2304. But 2304 * 3/4 = 1728. | ||
18 | So 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 | ||
21 | truesize.) | ||
22 | |||
23 | This also means tcp advertises a too optimistic window for a given | ||
24 | allocated rcvspace : When receiving frames, sk_rmem_alloc can hit | ||
25 | sk_rcvbuf limit and we call tcp_prune_queue()/tcp_collapse() too often, | ||
26 | especially when application is slow to drain its receive queue or in | ||
27 | case of losses (netperf is fast, scp is slow). This is a major latency | ||
28 | source. | ||
29 | |||
30 | We should adjust the len/truesize ratio to 50% instead of 75% | ||
31 | |||
32 | This patch : | ||
33 | |||
34 | 1) changes tcp_adv_win_scale default to 1 instead of 2 | ||
35 | |||
36 | 2) increase tcp_rmem[2] limit from 4MB to 6MB to take into account | ||
37 | better truesize tracking and to allow autotuning tcp receive window to | ||
38 | reach same value than before. Note that same amount of kernel memory is | ||
39 | consumed compared to 2.6 kernels. | ||
40 | |||
41 | Signed-off-by: Eric Dumazet <edumazet@google.com> | ||
42 | Cc: Neal Cardwell <ncardwell@google.com> | ||
43 | Cc: Tom Herbert <therbert@google.com> | ||
44 | Cc: Yuchung Cheng <ycheng@google.com> | ||
45 | Acked-by: Neal Cardwell <ncardwell@google.com> | ||
46 | Signed-off-by: David S. Miller <davem@davemloft.net> | ||
47 | Signed-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 | |||
54 | diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt | ||
55 | index 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). | ||
76 | diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c | ||
77 | index 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", | ||
109 | diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c | ||
110 | index 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 | -- | ||
123 | 1.7.7.6 | ||
124 | |||