diff options
Diffstat (limited to 'net/sctp/protocol.c')
-rw-r--r-- | net/sctp/protocol.c | 11 |
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; |