aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorMel Gorman <mel@csn.ul.ie>2009-06-16 18:31:56 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-16 22:47:32 -0400
commit7f82af9742a9346794ecc1515139daed480e7025 (patch)
tree4928b804c990263d1319d32fa61570fa34a25eb6 /mm
parent6484eb3e2a81807722c5f28efef94d8338b7b996 (diff)
page allocator: check only once if the zonelist is suitable for the allocation
It is possible with __GFP_THISNODE that no zones are suitable. This patch makes sure the check is only made once. Signed-off-by: Mel Gorman <mel@csn.ul.ie> Reviewed-by: Christoph Lameter <cl@linux-foundation.org> Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Reviewed-by: Pekka Enberg <penberg@cs.helsinki.fi> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Nick Piggin <nickpiggin@yahoo.com.au> Cc: Dave Hansen <dave@linux.vnet.ibm.com> Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/page_alloc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index bfbd95c0610f..6be8fcb6f74f 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1483,9 +1483,8 @@ __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order,
1483 if (should_fail_alloc_page(gfp_mask, order)) 1483 if (should_fail_alloc_page(gfp_mask, order))
1484 return NULL; 1484 return NULL;
1485 1485
1486restart: 1486 /* the list of zones suitable for gfp_mask */
1487 z = zonelist->_zonerefs; /* the list of zones suitable for gfp_mask */ 1487 z = zonelist->_zonerefs;
1488
1489 if (unlikely(!z->zone)) { 1488 if (unlikely(!z->zone)) {
1490 /* 1489 /*
1491 * Happens if we have an empty zonelist as a result of 1490 * Happens if we have an empty zonelist as a result of
@@ -1494,6 +1493,7 @@ restart:
1494 return NULL; 1493 return NULL;
1495 } 1494 }
1496 1495
1496restart:
1497 page = get_page_from_freelist(gfp_mask|__GFP_HARDWALL, nodemask, order, 1497 page = get_page_from_freelist(gfp_mask|__GFP_HARDWALL, nodemask, order,
1498 zonelist, high_zoneidx, ALLOC_WMARK_LOW|ALLOC_CPUSET); 1498 zonelist, high_zoneidx, ALLOC_WMARK_LOW|ALLOC_CPUSET);
1499 if (page) 1499 if (page)