Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 103648
b: refs/heads/master
c: 845525a
h: refs/heads/master
v: v3
  • Loading branch information
Vlad Yasevich authored and David S. Miller committed Jul 19, 2008
1 parent bde3050 commit 0940ed5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 336d3262df71fcd2661180bb35d5ea41b4cbca58
refs/heads/master: 845525a642c1c9e1335c33a274d4273906ee58eb
10 changes: 7 additions & 3 deletions trunk/net/sctp/protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
#include <linux/inetdevice.h>
#include <linux/seq_file.h>
#include <linux/bootmem.h>
#include <linux/highmem.h>
#include <linux/swap.h>
#include <net/net_namespace.h>
#include <net/protocol.h>
#include <net/ip.h>
Expand Down Expand Up @@ -1080,6 +1082,7 @@ SCTP_STATIC __init int sctp_init(void)
int status = -EINVAL;
unsigned long goal;
unsigned long limit;
unsigned long nr_pages;
int max_share;
int order;

Expand Down Expand Up @@ -1175,8 +1178,9 @@ SCTP_STATIC __init int sctp_init(void)
* Note this initalizes the data in sctpv6_prot too
* Unabashedly stolen from tcp_init
*/
limit = min(num_physpages, 1UL<<(28-PAGE_SHIFT)) >> (20-PAGE_SHIFT);
limit = (limit * (num_physpages >> (20-PAGE_SHIFT))) >> (PAGE_SHIFT-11);
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 = max(limit, 128UL);
sysctl_sctp_mem[0] = limit / 4 * 3;
sysctl_sctp_mem[1] = limit;
Expand All @@ -1186,7 +1190,7 @@ SCTP_STATIC __init int sctp_init(void)
limit = (sysctl_sctp_mem[1]) << (PAGE_SHIFT - 7);
max_share = min(4UL*1024*1024, limit);

sysctl_sctp_rmem[0] = PAGE_SIZE; /* give each asoc 1 page min */
sysctl_sctp_rmem[0] = SK_MEM_QUANTUM; /* give each asoc 1 page min */
sysctl_sctp_rmem[1] = (1500 *(sizeof(struct sk_buff) + 1));
sysctl_sctp_rmem[2] = max(sysctl_sctp_rmem[1], max_share);

Expand Down

0 comments on commit 0940ed5

Please sign in to comment.