Commit ab8b6bc2 authored by Jesse Barnes's avatar Jesse Barnes Committed by Linus Torvalds

[PATCH] fix find_next_best_node()

If NUMA is enabled, find_next_best_node is responsible for helping build
the zonelist for each pgdat in the system.  However, if one sets
PENALTY_FOR_NODE_WITH_CPUS to a large value in an attempt to prefer nodes
w/o CPUs, the local node is erroneously placed after all nodes w/o CPUs in
the pgdat's zonelist.  This small patch fixes that by just checking if the
local node is part of the zonelist yet, and if not, returns it first.
Signed-off-by: default avatarJesse Barnes <jbarnes@sgi.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent afcb4504
......@@ -1213,6 +1213,12 @@ static int __init find_next_best_node(int node, void *used_node_mask)
if (test_bit(n, used_node_mask))
continue;
/* Use the local node if we haven't already */
if (!test_bit(node, used_node_mask)) {
best_node = node;
break;
}
/* Use the distance array to find the distance */
val = node_distance(node, n);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment