Skip to contentSkip to conversation

Do not use arbitrary large movablecore to calculate kernelcore

PATCH In review Zhihui Zhang 2 participants 3 messages Mar 29, 2015 – Apr 3, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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
index 40e2942..32bf5da 100644
@@ -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
#1 lore raw
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.

I'm confused. What bug is this patch fixing? What is the user-visible impcat of the patch?

#2 lore raw

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.

I'm confused. What bug is this patch fixing? What is the user-visible impcat of the patch?