summaryrefslogtreecommitdiffstats
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
authorXishi Qiu <qiuxishi@huawei.com>2015-11-05 18:48:56 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2015-11-05 19:34:48 -0800
commitbde304bdf4ec4a5f58cc1e90fe2d9cd2d96304c4 (patch)
treed9adda3338bf50c3ce47b1d884689e0d3db848e1 /mm/page_alloc.c
parenta2c1aad3b5fccbb948878b75f9b8f13248666fd6 (diff)
downloadlinux-bde304bdf4ec4a5f58cc1e90fe2d9cd2d96304c4.tar.gz
linux-bde304bdf4ec4a5f58cc1e90fe2d9cd2d96304c4.tar.bz2
linux-bde304bdf4ec4a5f58cc1e90fe2d9cd2d96304c4.zip
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 <qiuxishi@huawei.com> Reviewed-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com> Cc: Mel Gorman <mgorman@suse.de> Cc: David Rientjes <rientjes@google.com> Cc: Tang Chen <tangchen@cn.fujitsu.com> Cc: <zhongjiang@huawei.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r--mm/page_alloc.c7
1 files changed, 5 insertions, 2 deletions
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 */