aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/page_alloc.c34
1 files changed, 11 insertions, 23 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 8f3de5af92dd..7adc9526d329 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1455,35 +1455,23 @@ void show_free_areas(void)
1455 1455
1456/* 1456/*
1457 * Builds allocation fallback zone lists. 1457 * Builds allocation fallback zone lists.
1458 *
1459 * Add all populated zones of a node to the zonelist.
1458 */ 1460 */
1459static int __init build_zonelists_node(pg_data_t *pgdat, struct zonelist *zonelist, int j, int k) 1461static int __init build_zonelists_node(pg_data_t *pgdat,
1460{ 1462 struct zonelist *zonelist, int j, int k)
1461 switch (k) { 1463{
1462 struct zone *zone; 1464 struct zone *zone;
1463 default: 1465
1464 BUG(); 1466 BUG_ON(k > ZONE_HIGHMEM);
1465 case ZONE_HIGHMEM: 1467 for (zone = pgdat->node_zones + k; zone >= pgdat->node_zones; zone--) {
1466 zone = pgdat->node_zones + ZONE_HIGHMEM; 1468 if (populated_zone(zone)) {
1467 if (zone->present_pages) {
1468#ifndef CONFIG_HIGHMEM 1469#ifndef CONFIG_HIGHMEM
1469 BUG(); 1470 BUG_ON(zone - pgdat->node_zones > ZONE_NORMAL);
1470#endif 1471#endif
1471 zonelist->zones[j++] = zone; 1472 zonelist->zones[j++] = zone;
1472 } 1473 }
1473 case ZONE_NORMAL:
1474 zone = pgdat->node_zones + ZONE_NORMAL;
1475 if (zone->present_pages)
1476 zonelist->zones[j++] = zone;
1477 case ZONE_DMA32:
1478 zone = pgdat->node_zones + ZONE_DMA32;
1479 if (zone->present_pages)
1480 zonelist->zones[j++] = zone;
1481 case ZONE_DMA:
1482 zone = pgdat->node_zones + ZONE_DMA;
1483 if (zone->present_pages)
1484 zonelist->zones[j++] = zone;
1485 } 1474 }
1486
1487 return j; 1475 return j;
1488} 1476}
1489 1477