aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2012-04-09 20:56:42 -0400
committerDavid S. Miller <davem@davemloft.net>2012-04-10 14:39:26 -0400
commit5fb84b1428b271f8767e0eb3fcd7231896edfaa4 (patch)
tree4e27fb488ee9a0ecc4fca1c736dc5415cebbe59c /net
parentecd159fc5f415fa742d5daa5b43200606e6ad493 (diff)
tcp: restore correct limit
Commit c43b874d5d714f (tcp: properly initialize tcp memory limits) tried to fix a regression added in commits 4acb4190 & 3dc43e3, but still get it wrong. Result is machines with low amount of memory have too small tcp_rmem[2] value and slow tcp receives : Per socket limit being 1/1024 of memory instead of 1/128 in old kernels, so rcv window is capped to small values. Fix this to match comment and previous behavior. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Cc: Jason Wang <jasowang@redhat.com> Cc: Glauber Costa <glommer@parallels.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/tcp.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 5d54ed30e821..7758a83f98ff 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -3302,8 +3302,7 @@ void __init tcp_init(void)
3302 3302
3303 tcp_init_mem(&init_net); 3303 tcp_init_mem(&init_net);
3304 /* Set per-socket limits to no more than 1/128 the pressure threshold */ 3304 /* Set per-socket limits to no more than 1/128 the pressure threshold */
3305 limit = nr_free_buffer_pages() << (PAGE_SHIFT - 10); 3305 limit = nr_free_buffer_pages() << (PAGE_SHIFT - 7);
3306 limit = max(limit, 128UL);
3307 max_share = min(4UL*1024*1024, limit); 3306 max_share = min(4UL*1024*1024, limit);
3308 3307
3309 sysctl_tcp_wmem[0] = SK_MEM_QUANTUM; 3308 sysctl_tcp_wmem[0] = SK_MEM_QUANTUM;