diff options
author | Mel Gorman <mel@csn.ul.ie> | 2008-04-28 05:12:14 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-28 11:58:18 -0400 |
commit | 0e88460da6ab7bb6a7ef83675412ed5b6315d741 (patch) | |
tree | 1feb4de2362e4998a0deeab66af1efb9c7b8bb34 /mm/mempolicy.c | |
parent | dac1d27bc8d5ca636d3014ecfdf94407031d1970 (diff) |
mm: introduce node_zonelist() for accessing the zonelist for a GFP mask
Introduce a node_zonelist() helper function. It is used to lookup the
appropriate zonelist given a node and a GFP mask. The patch on its own is a
cleanup but it helps clarify parts of the two-zonelist-per-node patchset. If
necessary, it can be merged with the next patch in this set without problems.
Reviewed-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: Lee Schermerhorn <lee.schermerhorn@hp.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Christoph Lameter <clameter@sgi.com>
Cc: Hugh Dickins <hugh@veritas.com>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.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 3c3601121509..5d20bf44062f 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c | |||
@@ -1183,7 +1183,7 @@ static struct zonelist *zonelist_policy(gfp_t gfp, struct mempolicy *policy) | |||
1183 | nd = 0; | 1183 | nd = 0; |
1184 | BUG(); | 1184 | BUG(); |
1185 | } | 1185 | } |
1186 | return NODE_DATA(nd)->node_zonelists + gfp_zone(gfp); | 1186 | return node_zonelist(nd, gfp); |
1187 | } | 1187 | } |
1188 | 1188 | ||
1189 | /* Do dynamic interleaving for a process */ | 1189 | /* Do dynamic interleaving for a process */ |
@@ -1299,7 +1299,7 @@ struct zonelist *huge_zonelist(struct vm_area_struct *vma, unsigned long addr, | |||
1299 | if (unlikely(pol != &default_policy && | 1299 | if (unlikely(pol != &default_policy && |
1300 | pol != current->mempolicy)) | 1300 | pol != current->mempolicy)) |
1301 | __mpol_free(pol); /* finished with pol */ | 1301 | __mpol_free(pol); /* finished with pol */ |
1302 | return NODE_DATA(nid)->node_zonelists + gfp_zone(gfp_flags); | 1302 | return node_zonelist(nid, gfp_flags); |
1303 | } | 1303 | } |
1304 | 1304 | ||
1305 | zl = zonelist_policy(GFP_HIGHUSER, pol); | 1305 | zl = zonelist_policy(GFP_HIGHUSER, pol); |
@@ -1321,7 +1321,7 @@ static struct page *alloc_page_interleave(gfp_t gfp, unsigned order, | |||
1321 | struct zonelist *zl; | 1321 | struct zonelist *zl; |
1322 | struct page *page; | 1322 | struct page *page; |
1323 | 1323 | ||
1324 | zl = NODE_DATA(nid)->node_zonelists + gfp_zone(gfp); | 1324 | zl = node_zonelist(nid, gfp); |
1325 | page = __alloc_pages(gfp, order, zl); | 1325 | page = __alloc_pages(gfp, order, zl); |
1326 | if (page && page_zone(page) == zl->zones[0]) | 1326 | if (page && page_zone(page) == zl->zones[0]) |
1327 | inc_zone_page_state(page, NUMA_INTERLEAVE_HIT); | 1327 | inc_zone_page_state(page, NUMA_INTERLEAVE_HIT); |