|
@@ -3229,7 +3229,6 @@ __setup("thash_entries=", set_thash_entries);
|
|
|
|
|
|
void tcp_init_mem(struct net *net)
|
|
|
{
|
|
|
- /* Set per-socket limits to no more than 1/128 the pressure threshold */
|
|
|
unsigned long limit = nr_free_buffer_pages() / 8;
|
|
|
limit = max(limit, 128UL);
|
|
|
net->ipv4.sysctl_tcp_mem[0] = limit / 4 * 3;
|
|
@@ -3298,7 +3297,8 @@ void __init tcp_init(void)
|
|
|
sysctl_max_syn_backlog = max(128, cnt / 256);
|
|
|
|
|
|
tcp_init_mem(&init_net);
|
|
|
- limit = nr_free_buffer_pages() / 8;
|
|
|
+ /* Set per-socket limits to no more than 1/128 the pressure threshold */
|
|
|
+ limit = nr_free_buffer_pages() << (PAGE_SHIFT - 10);
|
|
|
limit = max(limit, 128UL);
|
|
|
max_share = min(4UL*1024*1024, limit);
|
|
|
|