aboutsummaryrefslogtreecommitdiffstats
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
authorMel Gorman <mel@csn.ul.ie>2008-04-28 05:12:14 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-28 11:58:18 -0400
commit0e88460da6ab7bb6a7ef83675412ed5b6315d741 (patch)
tree1feb4de2362e4998a0deeab66af1efb9c7b8bb34 /mm/page_alloc.c
parentdac1d27bc8d5ca636d3014ecfdf94407031d1970 (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/page_alloc.c')
-rw-r--r--mm/page_alloc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 1bda771a072a..63ff71830ea4 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1713,10 +1713,9 @@ EXPORT_SYMBOL(free_pages);
1713static unsigned int nr_free_zone_pages(int offset) 1713static unsigned int nr_free_zone_pages(int offset)
1714{ 1714{
1715 /* Just pick one node, since fallback list is circular */ 1715 /* Just pick one node, since fallback list is circular */
1716 pg_data_t *pgdat = NODE_DATA(numa_node_id());
1717 unsigned int sum = 0; 1716 unsigned int sum = 0;
1718 1717
1719 struct zonelist *zonelist = pgdat->node_zonelists + offset; 1718 struct zonelist *zonelist = node_zonelist(numa_node_id(), GFP_KERNEL);
1720 struct zone **zonep = zonelist->zones; 1719 struct zone **zonep = zonelist->zones;
1721 struct zone *zone; 1720 struct zone *zone;
1722 1721