Commit 7f82af97 authored by Mel Gorman's avatar Mel Gorman Committed by Linus Torvalds
Browse files

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: default avatarMel Gorman <>
Reviewed-by: default avatarChristoph Lameter <>
Reviewed-by: default avatarKOSAKI Motohiro <>
Reviewed-by: default avatarPekka Enberg <>
Cc: Peter Zijlstra <>
Cc: Nick Piggin <>
Cc: Dave Hansen <>
Cc: Lee Schermerhorn <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 6484eb3e
......@@ -1483,9 +1483,8 @@ __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order,
if (should_fail_alloc_page(gfp_mask, order))
return NULL;
z = zonelist->_zonerefs; /* the list of zones suitable for gfp_mask */
/* the list of zones suitable for gfp_mask */
z = zonelist->_zonerefs;
if (unlikely(!z->zone)) {
* Happens if we have an empty zonelist as a result of
......@@ -1494,6 +1493,7 @@ restart:
return NULL;
page = get_page_from_freelist(gfp_mask|__GFP_HARDWALL, nodemask, order,
zonelist, high_zoneidx, ALLOC_WMARK_LOW|ALLOC_CPUSET);
if (page)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment