aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/protocol.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-07-14 10:56:40 -0400
committerDavid S. Miller <davem@davemloft.net>2011-07-14 10:56:40 -0400
commit6a7ebdf2fd15417e87b4fd02ff411aeaca34da5f (patch)
tree86b15d8cd3e25c97b348b5a61bdb16c02726a480 /net/sctp/protocol.c
parentf6b72b6217f8c24f2a54988e58af858b4e66024d (diff)
parent51414d41084496aaefd06d7f19eb8206e8bfac2d (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: net/bluetooth/l2cap_core.c
Diffstat (limited to 'net/sctp/protocol.c')
-rw-r--r--net/sctp/protocol.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index ab5ded2c58de..91784f44a2e2 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -1199,7 +1199,6 @@ SCTP_STATIC __init int sctp_init(void)
1199 int status = -EINVAL; 1199 int status = -EINVAL;
1200 unsigned long goal; 1200 unsigned long goal;
1201 unsigned long limit; 1201 unsigned long limit;
1202 unsigned long nr_pages;
1203 int max_share; 1202 int max_share;
1204 int order; 1203 int order;
1205 1204
@@ -1289,15 +1288,7 @@ SCTP_STATIC __init int sctp_init(void)
1289 /* Initialize handle used for association ids. */ 1288 /* Initialize handle used for association ids. */
1290 idr_init(&sctp_assocs_id); 1289 idr_init(&sctp_assocs_id);
1291 1290
1292 /* Set the pressure threshold to be a fraction of global memory that 1291 limit = nr_free_buffer_pages() / 8;
1293 * is up to 1/2 at 256 MB, decreasing toward zero with the amount of
1294 * memory, with a floor of 128 pages.
1295 * Note this initializes the data in sctpv6_prot too
1296 * Unabashedly stolen from tcp_init
1297 */
1298 nr_pages = totalram_pages - totalhigh_pages;
1299 limit = min(nr_pages, 1UL<<(28-PAGE_SHIFT)) >> (20-PAGE_SHIFT);
1300 limit = (limit * (nr_pages >> (20-PAGE_SHIFT))) >> (PAGE_SHIFT-11);
1301 limit = max(limit, 128UL); 1292 limit = max(limit, 128UL);
1302 sysctl_sctp_mem[0] = limit / 4 * 3; 1293 sysctl_sctp_mem[0] = limit / 4 * 3;
1303 sysctl_sctp_mem[1] = limit; 1294 sysctl_sctp_mem[1] = limit;