diff options
author | Jesse Barnes <jbarnes@engr.sgi.com> | 2004-11-07 03:39:22 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-11-07 03:39:22 -0800 |
commit | ab8b6bc23e496dcb823c6a129f316cb5babb0085 (patch) | |
tree | 7598f4903d7c01bfba36ab62fd6406017fa63177 /mm | |
parent | afcb4504418b6312c5c916b379a4a28edfb16a4e (diff) | |
download | history-ab8b6bc23e496dcb823c6a129f316cb5babb0085.tar.gz |
[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: Jesse Barnes <jbarnes@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/page_alloc.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 3d07ca3b170a5e..16c0787bb57a34 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -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); |