From: Mel Gorman Date: Tue, 16 Jun 2009 22:31:56 +0000 (-0700) Subject: page allocator: check only once if the zonelist is suitable for the allocation X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7f82af9742a9346794ecc1515139daed480e7025;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Reviewed-by: Christoph Lameter Reviewed-by: KOSAKI Motohiro Reviewed-by: Pekka Enberg Cc: Peter Zijlstra Cc: Nick Piggin Cc: Dave Hansen Cc: Lee Schermerhorn Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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, if (should_fail_alloc_page(gfp_mask, order)) return NULL; -restart: - 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; } +restart: page = get_page_from_freelist(gfp_mask|__GFP_HARDWALL, nodemask, order, zonelist, high_zoneidx, ALLOC_WMARK_LOW|ALLOC_CPUSET); if (page)