diff options
author | Hugh Dickins <hugh@veritas.com> | 2008-02-23 14:40:17 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-23 15:09:28 -0500 |
commit | 1e8352784abaedb424e63fa700e93e6c1307785f (patch) | |
tree | eb7ba51fa40e209ed2a1636b3404cca58141bed1 /include/asm-generic | |
parent | 3a2d5b700132f35401f1d9e22fe3c2cab02c2549 (diff) |
percpu: fix DEBUG_PREEMPT per_cpu checking
2.6.25-rc1 percpu changes broke CONFIG_DEBUG_PREEMPT's per_cpu checking
on several architectures. On s390, sparc64 and x86 it's been weakened to
not checking at all; whereas on powerpc64 it's become too strict, issuing
warnings from __raw_get_cpu_var in io_schedule and init_timer for example.
Fix this by weakening powerpc's __my_cpu_offset to use the non-checking
local_paca instead of get_paca (which itself contains such a check);
and strengthening the generic my_cpu_offset to go the old slow way via
smp_processor_id when CONFIG_DEBUG_PREEMPT (debug_smp_processor_id is
where all the knowledge of what's correct when lives).
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Reviewed-by: Mike Travis <travis@sgi.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/asm-generic')
-rw-r--r-- | include/asm-generic/percpu.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/asm-generic/percpu.h b/include/asm-generic/percpu.h index 4b8d31cda1a0..b0e63c672ebd 100644 --- a/include/asm-generic/percpu.h +++ b/include/asm-generic/percpu.h | |||
@@ -32,6 +32,8 @@ extern unsigned long __per_cpu_offset[NR_CPUS]; | |||
32 | */ | 32 | */ |
33 | #ifndef __my_cpu_offset | 33 | #ifndef __my_cpu_offset |
34 | #define __my_cpu_offset per_cpu_offset(raw_smp_processor_id()) | 34 | #define __my_cpu_offset per_cpu_offset(raw_smp_processor_id()) |
35 | #endif | ||
36 | #ifdef CONFIG_DEBUG_PREEMPT | ||
35 | #define my_cpu_offset per_cpu_offset(smp_processor_id()) | 37 | #define my_cpu_offset per_cpu_offset(smp_processor_id()) |
36 | #else | 38 | #else |
37 | #define my_cpu_offset __my_cpu_offset | 39 | #define my_cpu_offset __my_cpu_offset |