Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 20455
b: refs/heads/master
c: 4cf808e
h: refs/heads/master
i:
  20453: 4caf648
  20451: 74026cf
  20447: d1b5062
v: v3
  • Loading branch information
Linus Torvalds authored and Linus Torvalds committed Feb 17, 2006
1 parent b0e9143 commit f315735
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 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: cfe91f9ce297e23e6fbdf61c02bdd8ab9af7c8a8
refs/heads/master: 4cf808eb443ead42777a0230b73aec0cee7fb298
22 changes: 11 additions & 11 deletions trunk/mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1541,29 +1541,29 @@ static int __initdata node_load[MAX_NUMNODES];
*/
static int __init find_next_best_node(int node, nodemask_t *used_node_mask)
{
int i, n, val;
int n, val;
int min_val = INT_MAX;
int best_node = -1;

for_each_online_node(i) {
cpumask_t tmp;
/* Use the local node if we haven't already */
if (!node_isset(node, *used_node_mask)) {
node_set(node, *used_node_mask);
return node;
}

/* Start from local node */
n = (node+i) % num_online_nodes();
for_each_online_node(n) {
cpumask_t tmp;

/* Don't want a node to appear more than once */
if (node_isset(n, *used_node_mask))
continue;

/* Use the local node if we haven't already */
if (!node_isset(node, *used_node_mask)) {
best_node = node;
break;
}

/* Use the distance array to find the distance */
val = node_distance(node, n);

/* Penalize nodes under us ("prefer the next node") */
val += (n < node);

/* Give preference to headless and unused nodes */
tmp = node_to_cpumask(n);
if (!cpus_empty(tmp))
Expand Down

0 comments on commit f315735

Please sign in to comment.