aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r--net/ipv4/tcp.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index c2cff8b62772..565406287f6f 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -3515,7 +3515,7 @@ void __init tcp_init(void)
3515{ 3515{
3516 struct sk_buff *skb = NULL; 3516 struct sk_buff *skb = NULL;
3517 unsigned long limit; 3517 unsigned long limit;
3518 int max_share, cnt; 3518 int max_rshare, max_wshare, cnt;
3519 unsigned int i; 3519 unsigned int i;
3520 unsigned long jiffy = jiffies; 3520 unsigned long jiffy = jiffies;
3521 3521
@@ -3575,15 +3575,16 @@ void __init tcp_init(void)
3575 tcp_init_mem(&init_net); 3575 tcp_init_mem(&init_net);
3576 /* Set per-socket limits to no more than 1/128 the pressure threshold */ 3576 /* Set per-socket limits to no more than 1/128 the pressure threshold */
3577 limit = nr_free_buffer_pages() << (PAGE_SHIFT - 7); 3577 limit = nr_free_buffer_pages() << (PAGE_SHIFT - 7);
3578 max_share = min(4UL*1024*1024, limit); 3578 max_wshare = min(4UL*1024*1024, limit);
3579 max_rshare = min(6UL*1024*1024, limit);
3579 3580
3580 sysctl_tcp_wmem[0] = SK_MEM_QUANTUM; 3581 sysctl_tcp_wmem[0] = SK_MEM_QUANTUM;
3581 sysctl_tcp_wmem[1] = 16*1024; 3582 sysctl_tcp_wmem[1] = 16*1024;
3582 sysctl_tcp_wmem[2] = max(64*1024, max_share); 3583 sysctl_tcp_wmem[2] = max(64*1024, max_wshare);
3583 3584
3584 sysctl_tcp_rmem[0] = SK_MEM_QUANTUM; 3585 sysctl_tcp_rmem[0] = SK_MEM_QUANTUM;
3585 sysctl_tcp_rmem[1] = 87380; 3586 sysctl_tcp_rmem[1] = 87380;
3586 sysctl_tcp_rmem[2] = max(87380, max_share); 3587 sysctl_tcp_rmem[2] = max(87380, max_rshare);
3587 3588
3588 pr_info("Hash tables configured (established %u bind %u)\n", 3589 pr_info("Hash tables configured (established %u bind %u)\n",
3589 tcp_hashinfo.ehash_mask + 1, tcp_hashinfo.bhash_size); 3590 tcp_hashinfo.ehash_mask + 1, tcp_hashinfo.bhash_size);