Skip to content

Commit 1e83527

Browse files
Hugh DickinsLinus Torvalds
authored andcommitted
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>
1 parent 3a2d5b7 commit 1e83527

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

‎include/asm-generic/percpu.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ extern unsigned long __per_cpu_offset[NR_CPUS];
3232
*/
3333
#ifndef __my_cpu_offset
3434
#define __my_cpu_offset per_cpu_offset(raw_smp_processor_id())
35+
#endif
36+
#ifdef CONFIG_DEBUG_PREEMPT
3537
#define my_cpu_offset per_cpu_offset(smp_processor_id())
3638
#else
3739
#define my_cpu_offset __my_cpu_offset

‎include/asm-powerpc/percpu.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include <asm/paca.h>
1414

1515
#define __per_cpu_offset(cpu) (paca[cpu].data_offset)
16-
#define __my_cpu_offset get_paca()->data_offset
16+
#define __my_cpu_offset local_paca->data_offset
1717
#define per_cpu_offset(x) (__per_cpu_offset(x))
1818

1919
#endif /* CONFIG_SMP */

0 commit comments

Comments
 (0)