lkml.org 
[lkml]   [2003]   [Dec]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[TRIVIAL PATCH] Use valid node number when unmapping CPUs
The cpu_2_node array for i386 is initialized to 0 for each CPU, 
effectively mapping all CPUs to node 0 unless changed. When we unmap
CPUs, however, we stick a -1 in the array, mapping the CPU to an invalid
node. This really isn't helpful. We should map the CPU to node 0, to
make sure that callers of cpu_to_node() and friends aren't returned a
bogus node number. This trivial patch changes the unmapping code to
place a 0 in the node mapping for removed CPUs.

Cheers!

-Matt
diff -Nurp --exclude-from=/home/mcd/.dontdiff linux-2.6.0-vanilla/arch/i386/kernel/smpboot.c linux-2.6.0-patched/arch/i386/kernel/smpboot.c
--- linux-2.6.0-vanilla/arch/i386/kernel/smpboot.c Wed Dec 17 18:58:49 2003
+++ linux-2.6.0-patched/arch/i386/kernel/smpboot.c Thu Dec 18 14:36:06 2003
@@ -520,7 +520,7 @@ static inline void unmap_cpu_to_node(int
printk("Unmapping cpu %d from all nodes\n", cpu);
for (node = 0; node < MAX_NUMNODES; node ++)
cpu_clear(cpu, node_2_cpu_mask[node]);
- cpu_2_node[cpu] = -1;
+ cpu_2_node[cpu] = 0;
}
#else /* !CONFIG_NUMA */
\
 
 \ /
  Last update: 2005-03-22 13:59    [W:0.101 / U:0.752 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site