Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5f5cd8fd60c71ce47d2ce4e60e7ccbc306e91c64
Commit:     5f5cd8fd60c71ce47d2ce4e60e7ccbc306e91c64
Parent:     c49a4955ea504c82f6b690491639bba5b8c1dc47
Author:     Ingo Molnar <[EMAIL PROTECTED]>
AuthorDate: Wed Jan 30 13:33:23 2008 +0100
Committer:  Ingo Molnar <[EMAIL PROTECTED]>
CommitDate: Wed Jan 30 13:33:23 2008 +0100

    x86: add debug of invalid per_cpu map accesses
    
    dont crash survivable situations.
    
    Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
    Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>
---
 include/asm-x86/topology.h |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/include/asm-x86/topology.h b/include/asm-x86/topology.h
index f1e1232..9a8228a 100644
--- a/include/asm-x86/topology.h
+++ b/include/asm-x86/topology.h
@@ -66,14 +66,15 @@ static inline int early_cpu_to_node(int cpu)
 
 static inline int cpu_to_node(int cpu)
 {
-#ifdef CONFIG_DEBUG_PER_CPU_MAPS
-       if(x86_cpu_to_node_map_early_ptr) {
+#ifdef CONFIG_DEBUG_PER_CPU_MAPS
+       if (x86_cpu_to_node_map_early_ptr) {
                printk("KERN_NOTICE cpu_to_node(%d): usage too early!\n",
                        (int)cpu);
-               BUG();
+               dump_stack();
+               return ((int *)x86_cpu_to_node_map_early_ptr)[cpu];
        }
 #endif
-       if(per_cpu_offset(cpu))
+       if (per_cpu_offset(cpu))
                return per_cpu(x86_cpu_to_node_map, cpu);
        else
                return NUMA_NO_NODE;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to