Skip to content

Commit

Permalink
[PATCH] Fix zone policy determination
Browse files Browse the repository at this point in the history
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: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Christoph Lameter authored and Linus Torvalds committed Jan 6, 2006
1 parent 4be38e3 commit 02a68a5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1465,15 +1465,19 @@ static int __init build_zonelists_node(pg_data_t *pgdat,
struct zone *zone;

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)) {
#ifndef CONFIG_HIGHMEM
BUG_ON(zone - pgdat->node_zones > ZONE_NORMAL);
BUG_ON(k > ZONE_NORMAL);
#endif
zonelist->zones[j++] = zone;
check_highest_zone(k);
}
}
k--;

} while (k >= 0);
return j;
}

Expand Down

0 comments on commit 02a68a5

Please sign in to comment.