aboutsummaryrefslogtreecommitdiffstats
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
authorChristoph Lameter <clameter@sgi.com>2006-09-26 02:31:19 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-26 11:48:47 -0400
commit19655d3487001d7df0e10e9cbfc27c758b77c2b5 (patch)
tree8d0aaa216bd32bd64e3a9652fd34d40bdb9d1075 /mm/page_alloc.c
parent2f6726e54a9410e2e4cee864947c05e954051916 (diff)
[PATCH] linearly index zone->node_zonelists[]
I wonder why we need this bitmask indexing into zone->node_zonelists[]? We always start with the highest zone and then include all lower zones if we build zonelists. Are there really cases where we need allocation from ZONE_DMA or ZONE_HIGHMEM but not ZONE_NORMAL? It seems that the current implementation of highest_zone() makes that already impossible. If we go linear on the index then gfp_zone() == highest_zone() and a lot of definitions fall by the wayside. We can now revert back to the use of gfp_zone() in mempolicy.c ;-) Signed-off-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r--mm/page_alloc.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 9c44b9a39d30..208a6b03aa78 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1444,14 +1444,14 @@ static int __meminit find_next_best_node(int node, nodemask_t *used_node_mask)
1444 1444
1445static void __meminit build_zonelists(pg_data_t *pgdat) 1445static void __meminit build_zonelists(pg_data_t *pgdat)
1446{ 1446{
1447 int i, j, node, local_node; 1447 int j, node, local_node;
1448 enum zone_type i;
1448 int prev_node, load; 1449 int prev_node, load;
1449 struct zonelist *zonelist; 1450 struct zonelist *zonelist;
1450 nodemask_t used_mask; 1451 nodemask_t used_mask;
1451 enum zone_type k;
1452 1452
1453 /* initialize zonelists */ 1453 /* initialize zonelists */
1454 for (i = 0; i < GFP_ZONETYPES; i++) { 1454 for (i = 0; i < MAX_NR_ZONES; i++) {
1455 zonelist = pgdat->node_zonelists + i; 1455 zonelist = pgdat->node_zonelists + i;
1456 zonelist->zones[0] = NULL; 1456 zonelist->zones[0] = NULL;
1457 } 1457 }
@@ -1481,13 +1481,11 @@ static void __meminit build_zonelists(pg_data_t *pgdat)
1481 node_load[node] += load; 1481 node_load[node] += load;
1482 prev_node = node; 1482 prev_node = node;
1483 load--; 1483 load--;
1484 for (i = 0; i < GFP_ZONETYPES; i++) { 1484 for (i = 0; i < MAX_NR_ZONES; i++) {
1485 zonelist = pgdat->node_zonelists + i; 1485 zonelist = pgdat->node_zonelists + i;
1486 for (j = 0; zonelist->zones[j] != NULL; j++); 1486 for (j = 0; zonelist->zones[j] != NULL; j++);
1487 1487
1488 k = highest_zone(i); 1488 j = build_zonelists_node(NODE_DATA(node), zonelist, j, i);
1489
1490 j = build_zonelists_node(NODE_DATA(node), zonelist, j, k);
1491 zonelist->zones[j] = NULL; 1489 zonelist->zones[j] = NULL;
1492 } 1490 }
1493 } 1491 }
@@ -1497,19 +1495,16 @@ static void __meminit build_zonelists(pg_data_t *pgdat)
1497 1495
1498static void __meminit build_zonelists(pg_data_t *pgdat) 1496static void __meminit build_zonelists(pg_data_t *pgdat)
1499{ 1497{
1500 int i, node, local_node; 1498 int node, local_node;
1501 enum zone_type k; 1499 enum zone_type i,j;
1502 enum zone_type j;
1503 1500
1504 local_node = pgdat->node_id; 1501 local_node = pgdat->node_id;
1505 for (i = 0; i < GFP_ZONETYPES; i++) { 1502 for (i = 0; i < MAX_NR_ZONES; i++) {
1506 struct zonelist *zonelist; 1503 struct zonelist *zonelist;
1507 1504
1508 zonelist = pgdat->node_zonelists + i; 1505 zonelist = pgdat->node_zonelists + i;
1509 1506
1510 j = 0; 1507 j = build_zonelists_node(pgdat, zonelist, 0, i);
1511 k = highest_zone(i);
1512 j = build_zonelists_node(pgdat, zonelist, j, k);
1513 /* 1508 /*
1514 * Now we build the zonelist so that it contains the zones 1509 * Now we build the zonelist so that it contains the zones
1515 * of all the other nodes. 1510 * of all the other nodes.
@@ -1521,12 +1516,12 @@ static void __meminit build_zonelists(pg_data_t *pgdat)
1521 for (node = local_node + 1; node < MAX_NUMNODES; node++) { 1516 for (node = local_node + 1; node < MAX_NUMNODES; node++) {
1522 if (!node_online(node)) 1517 if (!node_online(node))
1523 continue; 1518 continue;
1524 j = build_zonelists_node(NODE_DATA(node), zonelist, j, k); 1519 j = build_zonelists_node(NODE_DATA(node), zonelist, j, i);
1525 } 1520 }
1526 for (node = 0; node < local_node; node++) { 1521 for (node = 0; node < local_node; node++) {
1527 if (!node_online(node)) 1522 if (!node_online(node))
1528 continue; 1523 continue;
1529 j = build_zonelists_node(NODE_DATA(node), zonelist, j, k); 1524 j = build_zonelists_node(NODE_DATA(node), zonelist, j, i);
1530 } 1525 }
1531 1526
1532 zonelist->zones[j] = NULL; 1527 zonelist->zones[j] = NULL;