Commit 02a68a5e authored by Christoph Lameter's avatar Christoph Lameter Committed by Linus Torvalds

[PATCH] Fix zone policy determination

The use k in the inner loop means that the highest zone nr is always used
if any zone of a node is populated.  This means that the policy zone is not
correctly determined on arches that do no use HIGHMEM like ia64.

Change the loop to decrement k which also simplifies the BUG_ON.
Signed-off-by: default avatarChristoph Lameter <clameter@sgi.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 4be38e35
...@@ -1465,15 +1465,19 @@ static int __init build_zonelists_node(pg_data_t *pgdat, ...@@ -1465,15 +1465,19 @@ static int __init build_zonelists_node(pg_data_t *pgdat,
struct zone *zone; struct zone *zone;
BUG_ON(k > ZONE_HIGHMEM); BUG_ON(k > ZONE_HIGHMEM);
for (zone = pgdat->node_zones + k; zone >= pgdat->node_zones; zone--) {
do {
zone = pgdat->node_zones + k;
if (populated_zone(zone)) { if (populated_zone(zone)) {
#ifndef CONFIG_HIGHMEM #ifndef CONFIG_HIGHMEM
BUG_ON(zone - pgdat->node_zones > ZONE_NORMAL); BUG_ON(k > ZONE_NORMAL);
#endif #endif
zonelist->zones[j++] = zone; zonelist->zones[j++] = zone;
check_highest_zone(k); check_highest_zone(k);
} }
} k--;
} while (k >= 0);
return j; return j;
} }
......
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