tcp: properly initialize tcp memory limits
Commit4acb4190
tries to fix the using uninitialized value introduced by commit3dc43e3
, but it would make the per-socket memory limits too small. This patch fixes this and also remove the redundant codes introduced in4acb4190
. Signed-off-by: Jason Wang <jasowang@redhat.com> Acked-by: Glauber Costa <glommer@parallels.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
786f528119
commit
c43b874d5d
@@ -778,7 +778,6 @@ EXPORT_SYMBOL_GPL(net_ipv4_ctl_path);
|
||||
static __net_init int ipv4_sysctl_init_net(struct net *net)
|
||||
{
|
||||
struct ctl_table *table;
|
||||
unsigned long limit;
|
||||
|
||||
table = ipv4_net_table;
|
||||
if (!net_eq(net, &init_net)) {
|
||||
@@ -815,11 +814,6 @@ static __net_init int ipv4_sysctl_init_net(struct net *net)
|
||||
net->ipv4.sysctl_rt_cache_rebuild_count = 4;
|
||||
|
||||
tcp_init_mem(net);
|
||||
limit = nr_free_buffer_pages() / 8;
|
||||
limit = max(limit, 128UL);
|
||||
net->ipv4.sysctl_tcp_mem[0] = limit / 4 * 3;
|
||||
net->ipv4.sysctl_tcp_mem[1] = limit;
|
||||
net->ipv4.sysctl_tcp_mem[2] = net->ipv4.sysctl_tcp_mem[0] * 2;
|
||||
|
||||
net->ipv4.ipv4_hdr = register_net_sysctl_table(net,
|
||||
net_ipv4_ctl_path, table);
|
||||
|
Reference in New Issue
Block a user