diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2011-07-15 20:11:34 -0600 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2011-07-15 20:11:34 -0600 |
commit | 8c11642a50555e584774737f7c296f9aece310cf (patch) | |
tree | 1ff8dfaf05479593ef2c50378a68dfc6aec495a5 /net/ipv4/tcp.c | |
parent | 5d10302f46df1d9a85c34ea97f9b6c29e414482e (diff) | |
parent | 620917de59eeb934b9f8cf35cc2d95c1ac8ed0fc (diff) | |
download | op-kernel-dev-8c11642a50555e584774737f7c296f9aece310cf.zip op-kernel-dev-8c11642a50555e584774737f7c296f9aece310cf.tar.gz |
Merge commit 'v3.0-rc7' into devicetree/next
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r-- | net/ipv4/tcp.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 054a59d..46febca 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -3220,7 +3220,7 @@ __setup("thash_entries=", set_thash_entries); void __init tcp_init(void) { struct sk_buff *skb = NULL; - unsigned long nr_pages, limit; + unsigned long limit; int i, max_share, cnt; unsigned long jiffy = jiffies; @@ -3277,13 +3277,7 @@ void __init tcp_init(void) sysctl_tcp_max_orphans = cnt / 2; sysctl_max_syn_backlog = max(128, cnt / 256); - /* Set the pressure threshold to be a fraction of global memory that - * is up to 1/2 at 256 MB, decreasing toward zero with the amount of - * memory, with a floor of 128 pages. - */ - nr_pages = totalram_pages - totalhigh_pages; - limit = min(nr_pages, 1UL<<(28-PAGE_SHIFT)) >> (20-PAGE_SHIFT); - limit = (limit * (nr_pages >> (20-PAGE_SHIFT))) >> (PAGE_SHIFT-11); + limit = nr_free_buffer_pages() / 8; limit = max(limit, 128UL); sysctl_tcp_mem[0] = limit / 4 * 3; sysctl_tcp_mem[1] = limit; |