diff options
author | Christoph Lameter <clameter@engr.sgi.com> | 2006-01-06 03:11:17 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-06 11:33:28 -0500 |
commit | 4be38e351c5f455f6f490f5aff29053e33ab4f99 (patch) | |
tree | fd7ba3678cdb5750894f58034f47076dd38c64ae /mm/mempolicy.c | |
parent | 1a93205bdffd9d7278d4a66081cdb48452522a58 (diff) |
[PATCH] mm: move determination of policy_zone into page allocator
Currently the function to build a zonelist for a BIND policy has the side
effect to set the policy_zone. This seems to be a bit strange. policy
zone seems to not be initialized elsewhere and therefore 0. Do we police
ZONE_DMA if no bind policy has been used yet?
This patch moves the determination of the zone to apply policies to into
the page allocator. We determine the zone while building the zonelist for
nodes.
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 | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 96714e2646ad..0f1d2b8a952b 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c | |||
@@ -93,7 +93,7 @@ static kmem_cache_t *sn_cache; | |||
93 | 93 | ||
94 | /* Highest zone. An specific allocation for a zone below that is not | 94 | /* Highest zone. An specific allocation for a zone below that is not |
95 | policied. */ | 95 | policied. */ |
96 | static int policy_zone; | 96 | int policy_zone = ZONE_DMA; |
97 | 97 | ||
98 | struct mempolicy default_policy = { | 98 | struct mempolicy default_policy = { |
99 | .refcnt = ATOMIC_INIT(1), /* never free it */ | 99 | .refcnt = ATOMIC_INIT(1), /* never free it */ |
@@ -131,17 +131,8 @@ static struct zonelist *bind_zonelist(nodemask_t *nodes) | |||
131 | if (!zl) | 131 | if (!zl) |
132 | return NULL; | 132 | return NULL; |
133 | num = 0; | 133 | num = 0; |
134 | for_each_node_mask(nd, *nodes) { | 134 | for_each_node_mask(nd, *nodes) |
135 | int k; | 135 | zl->zones[num++] = &NODE_DATA(nd)->node_zones[policy_zone]; |
136 | for (k = MAX_NR_ZONES-1; k >= 0; k--) { | ||
137 | struct zone *z = &NODE_DATA(nd)->node_zones[k]; | ||
138 | if (!z->present_pages) | ||
139 | continue; | ||
140 | zl->zones[num++] = z; | ||
141 | if (k > policy_zone) | ||
142 | policy_zone = k; | ||
143 | } | ||
144 | } | ||
145 | zl->zones[num] = NULL; | 136 | zl->zones[num] = NULL; |
146 | return zl; | 137 | return zl; |
147 | } | 138 | } |