diff options
| author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-03-16 22:28:52 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-03-16 22:28:52 -0400 |
| commit | 24c4ac070adffe4a21f3a8daf4aee7c98fa6c4f9 (patch) | |
| tree | 7c9c4aaccb58cdde8e50634b74a41041001b624f /net/ipv4 | |
| parent | c334ba9e11849f0f23254d82a3305f6174cfbd95 (diff) | |
| parent | d35690beda1429544d46c8eb34b2e3a8c37ab299 (diff) | |
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
[IPV6]: ipv6_fl_socklist is inadvertently shared.
[TCP]: Fix tcp_mem[] initialization.
[NET]: Copy mac_len in skb_clone() as well
[IPV4]: Do not disable preemption in trie_leaf_remove().
Diffstat (limited to 'net/ipv4')
| -rw-r--r-- | net/ipv4/fib_trie.c | 2 | ||||
| -rw-r--r-- | net/ipv4/tcp.c | 13 |
2 files changed, 10 insertions, 5 deletions
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index 72b3036bbc09..ada9b3db507d 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c | |||
| @@ -1527,7 +1527,6 @@ static int trie_leaf_remove(struct trie *t, t_key key) | |||
| 1527 | t->revision++; | 1527 | t->revision++; |
| 1528 | t->size--; | 1528 | t->size--; |
| 1529 | 1529 | ||
| 1530 | preempt_disable(); | ||
| 1531 | tp = NODE_PARENT(n); | 1530 | tp = NODE_PARENT(n); |
| 1532 | tnode_free((struct tnode *) n); | 1531 | tnode_free((struct tnode *) n); |
| 1533 | 1532 | ||
| @@ -1537,7 +1536,6 @@ static int trie_leaf_remove(struct trie *t, t_key key) | |||
| 1537 | rcu_assign_pointer(t->trie, trie_rebalance(t, tp)); | 1536 | rcu_assign_pointer(t->trie, trie_rebalance(t, tp)); |
| 1538 | } else | 1537 | } else |
| 1539 | rcu_assign_pointer(t->trie, NULL); | 1538 | rcu_assign_pointer(t->trie, NULL); |
| 1540 | preempt_enable(); | ||
| 1541 | 1539 | ||
| 1542 | return 1; | 1540 | return 1; |
| 1543 | } | 1541 | } |
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 74c4d103ebc2..3834b10b5115 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
| @@ -2458,11 +2458,18 @@ void __init tcp_init(void) | |||
| 2458 | sysctl_max_syn_backlog = 128; | 2458 | sysctl_max_syn_backlog = 128; |
| 2459 | } | 2459 | } |
| 2460 | 2460 | ||
| 2461 | /* Allow no more than 3/4 kernel memory (usually less) allocated to TCP */ | 2461 | /* Set the pressure threshold to be a fraction of global memory that |
| 2462 | sysctl_tcp_mem[0] = (1536 / sizeof (struct inet_bind_hashbucket)) << order; | 2462 | * is up to 1/2 at 256 MB, decreasing toward zero with the amount of |
| 2463 | sysctl_tcp_mem[1] = sysctl_tcp_mem[0] * 4 / 3; | 2463 | * memory, with a floor of 128 pages. |
| 2464 | */ | ||
| 2465 | limit = min(nr_all_pages, 1UL<<(28-PAGE_SHIFT)) >> (20-PAGE_SHIFT); | ||
| 2466 | limit = (limit * (nr_all_pages >> (20-PAGE_SHIFT))) >> (PAGE_SHIFT-11); | ||
| 2467 | limit = max(limit, 128UL); | ||
| 2468 | sysctl_tcp_mem[0] = limit / 4 * 3; | ||
| 2469 | sysctl_tcp_mem[1] = limit; | ||
| 2464 | sysctl_tcp_mem[2] = sysctl_tcp_mem[0] * 2; | 2470 | sysctl_tcp_mem[2] = sysctl_tcp_mem[0] * 2; |
| 2465 | 2471 | ||
| 2472 | /* Set per-socket limits to no more than 1/128 the pressure threshold */ | ||
| 2466 | limit = ((unsigned long)sysctl_tcp_mem[1]) << (PAGE_SHIFT - 7); | 2473 | limit = ((unsigned long)sysctl_tcp_mem[1]) << (PAGE_SHIFT - 7); |
| 2467 | max_share = min(4UL*1024*1024, limit); | 2474 | max_share = min(4UL*1024*1024, limit); |
| 2468 | 2475 | ||
