diff options
author | Christoph Lameter <clameter@sgi.com> | 2006-09-26 02:31:55 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-26 11:48:52 -0400 |
commit | 89fa30242facca249aead2aac03c4c69764f911c (patch) | |
tree | 1ac46b4777b819f2a4793d8e37330576ae5089ec /mm/mempolicy.c | |
parent | 4415cc8df630b05d3a54267d5f3e5c0b63a4ec05 (diff) |
[PATCH] NUMA: Add zone_to_nid function
There are many places where we need to determine the node of a zone.
Currently we use a difficult to read sequence of pointer dereferencing.
Put that into an inline function and use throughout VM. Maybe we can find
a way to optimize the lookup in the future.
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/mempolicy.c')
-rw-r--r-- | mm/mempolicy.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 8002e1faccda..38f89650bc84 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c | |||
@@ -487,7 +487,7 @@ static void get_zonemask(struct mempolicy *p, nodemask_t *nodes) | |||
487 | switch (p->policy) { | 487 | switch (p->policy) { |
488 | case MPOL_BIND: | 488 | case MPOL_BIND: |
489 | for (i = 0; p->v.zonelist->zones[i]; i++) | 489 | for (i = 0; p->v.zonelist->zones[i]; i++) |
490 | node_set(p->v.zonelist->zones[i]->zone_pgdat->node_id, | 490 | node_set(zone_to_nid(p->v.zonelist->zones[i]), |
491 | *nodes); | 491 | *nodes); |
492 | break; | 492 | break; |
493 | case MPOL_DEFAULT: | 493 | case MPOL_DEFAULT: |
@@ -1145,7 +1145,7 @@ unsigned slab_node(struct mempolicy *policy) | |||
1145 | * Follow bind policy behavior and start allocation at the | 1145 | * Follow bind policy behavior and start allocation at the |
1146 | * first node. | 1146 | * first node. |
1147 | */ | 1147 | */ |
1148 | return policy->v.zonelist->zones[0]->zone_pgdat->node_id; | 1148 | return zone_to_nid(policy->v.zonelist->zones[0]); |
1149 | 1149 | ||
1150 | case MPOL_PREFERRED: | 1150 | case MPOL_PREFERRED: |
1151 | if (policy->v.preferred_node >= 0) | 1151 | if (policy->v.preferred_node >= 0) |
@@ -1649,7 +1649,7 @@ void mpol_rebind_policy(struct mempolicy *pol, const nodemask_t *newmask) | |||
1649 | 1649 | ||
1650 | nodes_clear(nodes); | 1650 | nodes_clear(nodes); |
1651 | for (z = pol->v.zonelist->zones; *z; z++) | 1651 | for (z = pol->v.zonelist->zones; *z; z++) |
1652 | node_set((*z)->zone_pgdat->node_id, nodes); | 1652 | node_set(zone_to_nid(*z), nodes); |
1653 | nodes_remap(tmp, nodes, *mpolmask, *newmask); | 1653 | nodes_remap(tmp, nodes, *mpolmask, *newmask); |
1654 | nodes = tmp; | 1654 | nodes = tmp; |
1655 | 1655 | ||