aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-rw-r--r--mm/mempolicy.c2
-rw-r--r--mm/page_alloc.c27
2 files changed, 12 insertions, 17 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 7da4142ce960..c3429a710ab1 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -1101,7 +1101,7 @@ static struct zonelist *zonelist_policy(gfp_t gfp, struct mempolicy *policy)
1101 case MPOL_BIND: 1101 case MPOL_BIND:
1102 /* Lower zones don't get a policy applied */ 1102 /* Lower zones don't get a policy applied */
1103 /* Careful: current->mems_allowed might have moved */ 1103 /* Careful: current->mems_allowed might have moved */
1104 if (highest_zone(gfp) >= policy_zone) 1104 if (gfp_zone(gfp) >= policy_zone)
1105 if (cpuset_zonelist_valid_mems_allowed(policy->v.zonelist)) 1105 if (cpuset_zonelist_valid_mems_allowed(policy->v.zonelist))
1106 return policy->v.zonelist; 1106 return policy->v.zonelist;
1107 /*FALL THROUGH*/ 1107 /*FALL THROUGH*/
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;