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>
This commit is contained in:
Mel Gorman
2008-04-28 02:12:14 -07:00
committed by Linus Torvalds
parent dac1d27bc8
commit 0e88460da6
8 changed files with 17 additions and 17 deletions

View File

@@ -361,13 +361,13 @@ void invalidate_bdev(struct block_device *bdev)
static void free_more_memory(void)
{
struct zonelist *zonelist;
pg_data_t *pgdat;
int nid;
wakeup_pdflush(1024);
yield();
for_each_online_pgdat(pgdat) {
zonelist = &pgdat->node_zonelists[gfp_zone(GFP_NOFS)];
for_each_online_node(nid) {
zonelist = node_zonelist(nid, GFP_NOFS);
if (zonelist->zones[0])
try_to_free_pages(zonelist, 0, GFP_NOFS);
}