diff options
| author | Steve French <sfrench@us.ibm.com> | 2006-02-18 10:07:18 -0500 |
|---|---|---|
| committer | Steve French <sfrench@us.ibm.com> | 2006-02-18 10:07:18 -0500 |
| commit | e601ef22bc5ec9332c8d785533895ee81c834b8a (patch) | |
| tree | 4685a666fe2a553dccdfe7b4b3f88816d075b29e /mm/page_alloc.c | |
| parent | 27754b34600770beb38e3ae12cb3f345f02e3797 (diff) | |
| parent | bd71c2b17468a2531fb4c81ec1d73520845e97e1 (diff) | |
Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'mm/page_alloc.c')
| -rw-r--r-- | mm/page_alloc.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 62c122528587..208812b25597 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
| @@ -1541,29 +1541,29 @@ static int __initdata node_load[MAX_NUMNODES]; | |||
| 1541 | */ | 1541 | */ |
| 1542 | static int __init find_next_best_node(int node, nodemask_t *used_node_mask) | 1542 | static int __init find_next_best_node(int node, nodemask_t *used_node_mask) |
| 1543 | { | 1543 | { |
| 1544 | int i, n, val; | 1544 | int n, val; |
| 1545 | int min_val = INT_MAX; | 1545 | int min_val = INT_MAX; |
| 1546 | int best_node = -1; | 1546 | int best_node = -1; |
| 1547 | 1547 | ||
| 1548 | for_each_online_node(i) { | 1548 | /* Use the local node if we haven't already */ |
| 1549 | cpumask_t tmp; | 1549 | if (!node_isset(node, *used_node_mask)) { |
| 1550 | node_set(node, *used_node_mask); | ||
| 1551 | return node; | ||
| 1552 | } | ||
| 1550 | 1553 | ||
| 1551 | /* Start from local node */ | 1554 | for_each_online_node(n) { |
| 1552 | n = (node+i) % num_online_nodes(); | 1555 | cpumask_t tmp; |
| 1553 | 1556 | ||
| 1554 | /* Don't want a node to appear more than once */ | 1557 | /* Don't want a node to appear more than once */ |
| 1555 | if (node_isset(n, *used_node_mask)) | 1558 | if (node_isset(n, *used_node_mask)) |
| 1556 | continue; | 1559 | continue; |
| 1557 | 1560 | ||
| 1558 | /* Use the local node if we haven't already */ | ||
| 1559 | if (!node_isset(node, *used_node_mask)) { | ||
| 1560 | best_node = node; | ||
| 1561 | break; | ||
| 1562 | } | ||
| 1563 | |||
| 1564 | /* Use the distance array to find the distance */ | 1561 | /* Use the distance array to find the distance */ |
| 1565 | val = node_distance(node, n); | 1562 | val = node_distance(node, n); |
| 1566 | 1563 | ||
| 1564 | /* Penalize nodes under us ("prefer the next node") */ | ||
| 1565 | val += (n < node); | ||
| 1566 | |||
| 1567 | /* Give preference to headless and unused nodes */ | 1567 | /* Give preference to headless and unused nodes */ |
| 1568 | tmp = node_to_cpumask(n); | 1568 | tmp = node_to_cpumask(n); |
| 1569 | if (!cpus_empty(tmp)) | 1569 | if (!cpus_empty(tmp)) |
