aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/ipv4/tcp.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 4322318ab332..c05e8edaf544 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2316,9 +2316,10 @@ void __init tcp_init(void)
2316 sysctl_max_syn_backlog = 128; 2316 sysctl_max_syn_backlog = 128;
2317 } 2317 }
2318 2318
2319 sysctl_tcp_mem[0] = 768 << order; 2319 /* Allow no more than 3/4 kernel memory (usually less) allocated to TCP */
2320 sysctl_tcp_mem[1] = 1024 << order; 2320 sysctl_tcp_mem[0] = (1536 / sizeof (struct inet_bind_hashbucket)) << order;
2321 sysctl_tcp_mem[2] = 1536 << order; 2321 sysctl_tcp_mem[1] = sysctl_tcp_mem[0] * 4 / 3;
2322 sysctl_tcp_mem[2] = sysctl_tcp_mem[0] * 2;
2322 2323
2323 limit = ((unsigned long)sysctl_tcp_mem[1]) << (PAGE_SHIFT - 7); 2324 limit = ((unsigned long)sysctl_tcp_mem[1]) << (PAGE_SHIFT - 7);
2324 max_share = min(4UL*1024*1024, limit); 2325 max_share = min(4UL*1024*1024, limit);