Skip to contentSkip to conversation

trivial ia64 numa/discontig fixes

PATCH In review Alex Williamson 2 participants 2 messages Oct 22, 2003

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 trivial ia64 numa/discontig fixes

I stumbled on a couple trivial bugs in ia64 numa/discontig support.
The first just sets the default number of nodes to something reasonable for a generic kernel, otherwise it's really easy to start walking over your initdata (more error checking should probably be added). The second fixes a memcpy to a physical address. Patch below, please apply. Thanks,

Alex

Signature · 24 lines
Alex Williamson                             HP Linux & Open Source Lab

--- linux-2.5/include/asm-ia64/numnodes.h	Wed Oct 22 15:14:03 2003
+++ linux-2.5/include/asm-ia64/numnodes.h	Wed Oct 22 13:26:08 2003
@@ -4,7 +4,7 @@
 #ifdef CONFIG_IA64_DIG
 /* Max 8 Nodes */
 #define NODES_SHIFT	3
-#elif defined(CONFIG_IA64_SGI_SN2)
+#elif defined(CONFIG_IA64_SGI_SN2) || defined(CONFIG_IA64_GENERIC)
 /* Max 128 Nodes */
 #define NODES_SHIFT	7
 #endif
--- linux-2.5/arch/ia64/mm/discontig.c	Wed Oct 22 15:13:48 2003
+++ linux-2.5/arch/ia64/mm/discontig.c	Wed Oct 22 15:16:42 2003
@@ -186,7 +186,7 @@
 			 */
 			for (cpu = 0; cpu < NR_CPUS; cpu++) {
 				if (node == node_cpuid[cpu].nid) {
-					memcpy(cpu_data, __phys_per_cpu_start,
+					memcpy(__va(cpu_data), __phys_per_cpu_start,
 					       __per_cpu_end-__per_cpu_start);
 					__per_cpu_offset[cpu] =
 						(char*)__va(cpu_data) -
#1 lore raw

arch/ia64/mm/discontig.c line 192

Quoted 11 lines · Alex Williamson
arch/ia64/mm/discontig.c +1 -1
@@ -186,7 +186,7 @@
 			 */
 			for (cpu = 0; cpu < NR_CPUS; cpu++) {
 				if (node == node_cpuid[cpu].nid) {
-					memcpy(cpu_data, __phys_per_cpu_start,
+					memcpy(__va(cpu_data), __phys_per_cpu_start,
 					       __per_cpu_end-__per_cpu_start);
 					__per_cpu_offset[cpu] =
 						(char*)__va(cpu_data) -

If we put the __va() above where cpu_data is set, we can remove it from both places in the loop... Just thought that might be clearer since the other assignments use __va() above.

Jesse