Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 80351
b: refs/heads/master
c: c49a495
h: refs/heads/master
i:
  80349: 7aa472a
  80347: 549e984
  80343: 81f2836
  80335: d06f2be
  80319: ad716d8
v: v3
  • Loading branch information
travis@sgi.com authored and Ingo Molnar committed Jan 30, 2008
1 parent f61ae56 commit efd00d8
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 602a54a8cab2759fceb20b3e0c2a27c4eac005df
refs/heads/master: c49a4955ea504c82f6b690491639bba5b8c1dc47
12 changes: 12 additions & 0 deletions trunk/arch/x86/Kconfig.debug
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,18 @@ config DEBUG_PAGEALLOC
This results in a large slowdown, but helps to find certain types
of memory corruptions.

config DEBUG_PER_CPU_MAPS
bool "Debug access to per_cpu maps"
depends on DEBUG_KERNEL
depends on X86_64_SMP
default n
help
Say Y to verify that the per_cpu map being accessed has
been setup. Adds a fair amount of code to kernel memory
and decreases performance.

Say N if unsure.

config DEBUG_RODATA
bool "Write protect kernel read-only data structures"
depends on DEBUG_KERNEL
Expand Down
3 changes: 3 additions & 0 deletions trunk/arch/x86/mm/numa_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ u16 x86_cpu_to_node_map_init[NR_CPUS] = {
void *x86_cpu_to_node_map_early_ptr;
DEFINE_PER_CPU(u16, x86_cpu_to_node_map) = NUMA_NO_NODE;
EXPORT_PER_CPU_SYMBOL(x86_cpu_to_node_map);
#ifdef CONFIG_DEBUG_PER_CPU_MAPS
EXPORT_SYMBOL(x86_cpu_to_node_map_early_ptr);
#endif

u16 apicid_to_node[MAX_LOCAL_APIC] __cpuinitdata = {
[0 ... MAX_LOCAL_APIC-1] = NUMA_NO_NODE
Expand Down
7 changes: 7 additions & 0 deletions trunk/include/asm-x86/topology.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit efd00d8

Please sign in to comment.