Skip to contentSkip to conversation

x86_64 hot-add memroy srat.c fix

PATCH In review keith mannthey 2 participants 3 messages Oct 6, 2006 – Oct 16, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86_64 hot-add memroy srat.c fix

This patch corrects the logic used in srat.c to figure out what
parsing what action to take when registering hot-add areas. Hot-add areas should only be added to the node information for the MEMORY_HOTPLGU_RESERVE case. When booting MEMORY_HOTPLUG_SPARSE hot-add areas on everything but the last node are getting include in the node data and during kernel boot the pages are setup then the kernel dies when the pages are used. This patch fixes this issue. It is based against 2.6.19-rc1.

---
srat.c | 4 ++--

 1 files changed, 2 insertions(+), 2 deletions(-)
arch/x86_64/mm/srat.c +2 -2
diff -urN linux-2.6.18/arch/x86_64/mm/srat.c linux-2.6.18-rc1/arch/x86_64/mm/srat.c
@@ -207,7 +207,7 @@
 	return hotadd_percent > 0;
 }
 #else
-int update_end_of_memory(unsigned long end) {return 0;}
+int update_end_of_memory(unsigned long end) {return -1;}
 static int hotadd_enough_memory(struct bootnode *nd) {return 1;}
 #ifdef CONFIG_MEMORY_HOTPLUG_SPARSE
 static inline int save_add_info(void) {return 1;}
@@ -337,7 +337,7 @@
 	push_node_boundaries(node, nd->start >> PAGE_SHIFT,
 						nd->end >> PAGE_SHIFT);
 
- 	if (ma->flags.hot_pluggable && !reserve_hotadd(node, start, end) < 0) {
+ 	if (ma->flags.hot_pluggable && (reserve_hotadd(node, start, end) < 0)) {
 		/* Ignore hotadd region. Undo damage */
 		printk(KERN_NOTICE "SRAT: Hotplug region ignored\n");
 		*nd = oldnode;
#1 lore raw
Quoted 8 lines · keith mannthey

This patch corrects the logic used in srat.c to figure out what
parsing what action to take when registering hot-add areas. Hot-add areas should only be added to the node information for the MEMORY_HOTPLGU_RESERVE case. When booting MEMORY_HOTPLUG_SPARSE hot-add areas on everything but the last node are getting include in the node data and during kernel boot the pages are setup then the kernel dies when the pages are used. This patch fixes this issue. It is based against 2.6.19-rc1.

Added thanks, especially since it's a obvious typo.

If that patch was added to .19 does sparsemem hotadd work then or does it need more patches?

-Andi

#2 lore raw
Quoted 11 lines · Andi Kleen
Quoted 8 lines · keith mannthey

This patch corrects the logic used in srat.c to figure out what
parsing what action to take when registering hot-add areas. Hot-add areas should only be added to the node information for the MEMORY_HOTPLGU_RESERVE case. When booting MEMORY_HOTPLUG_SPARSE hot-add areas on everything but the last node are getting include in the node data and during kernel boot the pages are setup then the kernel dies when the pages are used. This patch fixes this issue. It is based against 2.6.19-rc1.

Added thanks, especially since it's a obvious typo.

Yea... Something pre 2.6.19 was removing the e820 reserved area before the nodes were brought online (and thus masking the problem during testing).

Quoted 2 lines

If that patch was added to .19 does sparsemem hotadd work then or does it need more patches?

SPARSEMEM hot-add will work in .19 if this patch is applied.

Thanks,
Keith