commit | 9fd745d450e7e2b0d2f1b386b886e7d568b64404 | [log] [tgz] |
---|---|---|
author | Xishi Qiu <[email protected]> | Thu Nov 05 18:48:11 2015 -0800 |
committer | Linus Torvalds <[email protected]> | Thu Nov 05 19:34:48 2015 -0800 |
tree | e202e5a23fc2e03b2905fdaffa130a991a9d0957 | |
parent | d031a157915e0508ffa1ab9f1bbf977257529cb4 [diff] [blame] |
mm: fix overflow in find_zone_movable_pfns_for_nodes() If the user set "movablecore=xx" to a large number, corepages will overflow. Fix the problem. Signed-off-by: Xishi Qiu <[email protected]> Reviewed-by: Yasuaki Ishimatsu <[email protected]> Acked-by: Tang Chen <[email protected]> Acked-by: David Rientjes <[email protected]> Cc: Mel Gorman <[email protected]> Cc: Tang Chen <[email protected]> Cc: Zhang Yanfei <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index c60605d..4aed338 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c
@@ -5666,6 +5666,7 @@ */ required_movablecore = roundup(required_movablecore, MAX_ORDER_NR_PAGES); + required_movablecore = min(totalpages, required_movablecore); corepages = totalpages - required_movablecore; required_kernelcore = max(required_kernelcore, corepages);