aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/cpuset.c
diff options
context:
space:
mode:
authorChristoph Lameter <clameter@sgi.com>2006-09-26 02:31:55 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-26 11:48:52 -0400
commit89fa30242facca249aead2aac03c4c69764f911c (patch)
tree1ac46b4777b819f2a4793d8e37330576ae5089ec /kernel/cpuset.c
parent4415cc8df630b05d3a54267d5f3e5c0b63a4ec05 (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 'kernel/cpuset.c')
-rw-r--r--kernel/cpuset.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index 76940361273e..cff41511269f 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -2245,7 +2245,7 @@ int cpuset_zonelist_valid_mems_allowed(struct zonelist *zl)
2245 int i; 2245 int i;
2246 2246
2247 for (i = 0; zl->zones[i]; i++) { 2247 for (i = 0; zl->zones[i]; i++) {
2248 int nid = zl->zones[i]->zone_pgdat->node_id; 2248 int nid = zone_to_nid(zl->zones[i]);
2249 2249
2250 if (node_isset(nid, current->mems_allowed)) 2250 if (node_isset(nid, current->mems_allowed))
2251 return 1; 2251 return 1;
@@ -2318,7 +2318,7 @@ int __cpuset_zone_allowed(struct zone *z, gfp_t gfp_mask)
2318 2318
2319 if (in_interrupt() || (gfp_mask & __GFP_THISNODE)) 2319 if (in_interrupt() || (gfp_mask & __GFP_THISNODE))
2320 return 1; 2320 return 1;
2321 node = z->zone_pgdat->node_id; 2321 node = zone_to_nid(z);
2322 might_sleep_if(!(gfp_mask & __GFP_HARDWALL)); 2322 might_sleep_if(!(gfp_mask & __GFP_HARDWALL));
2323 if (node_isset(node, current->mems_allowed)) 2323 if (node_isset(node, current->mems_allowed))
2324 return 1; 2324 return 1;