Commit 52bf376c authored by John Heffner's avatar John Heffner Committed by David S. Miller

[TCP]: Fix up sysctl_tcp_mem initialization.

Fix up tcp_mem initial settings to take into account the size of the
hash entries (different on SMP and non-SMP systems).
Signed-off-by: default avatarJohn Heffner <jheffner@psc.edu>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 337dde79
...@@ -2316,9 +2316,10 @@ void __init tcp_init(void) ...@@ -2316,9 +2316,10 @@ void __init tcp_init(void)
sysctl_max_syn_backlog = 128; sysctl_max_syn_backlog = 128;
} }
sysctl_tcp_mem[0] = 768 << order; /* Allow no more than 3/4 kernel memory (usually less) allocated to TCP */
sysctl_tcp_mem[1] = 1024 << order; sysctl_tcp_mem[0] = (1536 / sizeof (struct inet_bind_hashbucket)) << order;
sysctl_tcp_mem[2] = 1536 << order; sysctl_tcp_mem[1] = sysctl_tcp_mem[0] * 4 / 3;
sysctl_tcp_mem[2] = sysctl_tcp_mem[0] * 2;
limit = ((unsigned long)sysctl_tcp_mem[1]) << (PAGE_SHIFT - 7); limit = ((unsigned long)sysctl_tcp_mem[1]) << (PAGE_SHIFT - 7);
max_share = min(4UL*1024*1024, limit); max_share = min(4UL*1024*1024, limit);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment