From: Xishi Qiu Date: Fri, 6 Nov 2015 02:48:56 +0000 (-0800) Subject: mm/page_alloc.c: skip ZONE_MOVABLE if required_kernelcore is larger than totalpages X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bde304bdf4ec4a5f58cc1e90fe2d9cd2d96304c4;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git mm/page_alloc.c: skip ZONE_MOVABLE if required_kernelcore is larger than totalpages If kernelcore was not specified, or the kernelcore size is zero (required_movablecore >= totalpages), or the kernelcore size is larger than totalpages, there is no ZONE_MOVABLE. We should fill the zone with both kernel memory and movable memory. Signed-off-by: Xishi Qiu Reviewed-by: Yasuaki Ishimatsu Cc: Mel Gorman Cc: David Rientjes Cc: Tang Chen Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 86f7d952e2cc..06e62300d627 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -5675,8 +5675,11 @@ static void __init find_zone_movable_pfns_for_nodes(void) required_kernelcore = max(required_kernelcore, corepages); } - /* If kernelcore was not specified, there is no ZONE_MOVABLE */ - if (!required_kernelcore) + /* + * If kernelcore was not specified or kernelcore size is larger + * than totalpages, there is no ZONE_MOVABLE. + */ + if (!required_kernelcore || required_kernelcore >= totalpages) goto out; /* usable_startpfn is the lowest possible pfn ZONE_MOVABLE can be at */