x86: add debug of invalid per_cpu map accesses
Provide a means to trap usages of per_cpu map variables before they are setup. Define CONFIG_DEBUG_PER_CPU_MAPS to activate. Signed-off-by: Mike Travis <travis@sgi.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
This commit is contained in:
committed by
Ingo Molnar
parent
602a54a8ca
commit
c49a4955ea
@ -66,6 +66,13 @@ 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) {
|
||||
printk("KERN_NOTICE cpu_to_node(%d): usage too early!\n",
|
||||
(int)cpu);
|
||||
BUG();
|
||||
}
|
||||
#endif
|
||||
if(per_cpu_offset(cpu))
|
||||
return per_cpu(x86_cpu_to_node_map, cpu);
|
||||
else
|
||||
|
Reference in New Issue
Block a user