Skip to content

Commit 7f82af9

Browse files
gormanmtorvalds
authored andcommitted
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>
1 parent 6484eb3 commit 7f82af9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mm/page_alloc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1483,9 +1483,8 @@ __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order,
14831483
if (should_fail_alloc_page(gfp_mask, order))
14841484
return NULL;
14851485

1486-
restart:
1487-
z = zonelist->_zonerefs; /* the list of zones suitable for gfp_mask */
1488-
1486+
/* the list of zones suitable for gfp_mask */
1487+
z = zonelist->_zonerefs;
14891488
if (unlikely(!z->zone)) {
14901489
/*
14911490
* Happens if we have an empty zonelist as a result of
@@ -1494,6 +1493,7 @@ __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order,
14941493
return NULL;
14951494
}
14961495

1496+
restart:
14971497
page = get_page_from_freelist(gfp_mask|__GFP_HARDWALL, nodemask, order,
14981498
zonelist, high_zoneidx, ALLOC_WMARK_LOW|ALLOC_CPUSET);
14991499
if (page)

0 commit comments

Comments
 (0)