Do not use arbitrary large movablecore to calculate kernelcore
Subsystems (2)
PATCH 1/1 Do not use arbitrary large movablecore to calculate kernelcore
If kernelcore is not set, then we are working with a very large kernelcore for nothing - no movable zone will be created. If kernelcore is set, then it is not respected at all.
--- mm/page_alloc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
mm/page_alloc.c +5 -1
@@ -5199,7 +5199,11 @@ static void __init find_zone_movable_pfns_for_nodes(void)*/ required_movablecore =roundup (required_movablecore,MAX_ORDER_NR_PAGES ); - corepages = totalpages - required_movablecore; + +if (totalpages > required_movablecore) + corepages = totalpages - required_movablecore; +else + corepages =0 ; required_kernelcore =max (required_kernelcore, corepages); }
Signature · 1 line
1.9.1
Quoted 5 lines · Zhihui Zhang
If kernelcore is not set, then we are working with a very large kernelcore for nothing - no movable zone will be created. If kernelcore is set, then it is not respected at all.
Signed-off-by Zhihui Zhang <[email protected]>
I'm confused. What bug is this patch fixing? What is the user-visible impcat of the patch?
If you specify movablecore > totalpages, required_kernelcore will end up with a big number because corepages is an unsigned integer. If so, the following nested is a waste of time. But I see your point.
-Zhihui
Quoted 9 lines · Mel Gorman
Quoted 5 lines · Zhihui Zhang
If kernelcore is not set, then we are working with a very large kernelcore for nothing - no movable zone will be created. If kernelcore is set, then it is not respected at all.
Signed-off-by Zhihui Zhang <[email protected]>I'm confused. What bug is this patch fixing? What is the user-visible impcat of the patch?