percpu changes for v2.6.40
Hello, Linus.
Please pull from the following branch.
git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu.git for-2.6.40
The only interesting one is Eric's extra NOP removal from percpu_cmpxchg16b_double(). Other commits shouldn't cause noticeable behavior difference. The extra merge commit is to pull in non-critical fix patches which were waiting for further fixes during 2.6.39 cycle (only the merge commit itself is new).
When pulled into the current mainline, the following conflict occurs.
#ifdef CONFIG_SMP
#define CMPXCHG16B_EMU_CALL "call this_cpu_cmpxchg16b_emu\n\t" P6_NOP3 #else
#define CMPXCHG16B_EMU_CALL "call this_cpu_cmpxchg16b_emu\n\t" P6_NOP2 #endif
#define percpu_cmpxchg16b_double(pcp1, o1, o2, n1, n2) \
({ \
char __ret; \
typeof(o1) __o1 = o1; \
typeof(o1) __n1 = n1; \
typeof(o2) __o2 = o2; \
typeof(o2) __n2 = n2; \
typeof(o2) __dummy; \
<<<<<<< HEAD
alternative_io("call this_cpu_cmpxchg16b_emu\n\t" ASM_NOP4, \
=======
alternative_io(CMPXCHG16B_EMU_CALL, \Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
6988f20fe04e9ef3aea488cb8ab57fbeb78e12f0
"cmpxchg16b " __percpu_prefix "(%%rsi)\n\tsetz %0\n\t", \
X86_FEATURE_CX16, \
ASM_OUTPUT2("=a"(__ret), "=d"(__dummy)), \
"S" (&pcp1), "b"(__n1), "c"(__n2), \
"a"(__o1), "d"(__o2) : "memory"); \
__ret; \})
This is caused between b1e7734f02 (x86, percpu: Use ASM_NOP4 instead of hardcoding P6_NOP4) and 5f55924dea (percpu: Avoid extra NOP in percpu_cmpxchg16b_double). The former updates P6_NOP4 used in percpu_cmpxchg16b_double() to ASM_NOP4 while the latter makes the whole thing into CMPXCHG16B_EMU_CALL macro which changes depending on CONFIG_SMP.
Updating CMPXCHG16B_EMU_CALL macro to use ASM_NOP* and using it resolves the conflict, which looks like the following.
#ifdef CONFIG_SMP
#define CMPXCHG16B_EMU_CALL "call this_cpu_cmpxchg16b_emu\n\t" ASM_NOP3 #else
#define CMPXCHG16B_EMU_CALL "call this_cpu_cmpxchg16b_emu\n\t" ASM_NOP2 #endif
#define percpu_cmpxchg16b_double(pcp1, o1, o2, n1, n2) \
({ \
char __ret; \
typeof(o1) __o1 = o1; \
typeof(o1) __n1 = n1; \
typeof(o2) __o2 = o2; \
typeof(o2) __n2 = n2; \
typeof(o2) __dummy; \
alternative_io(CMPXCHG16B_EMU_CALL, \
"cmpxchg16b " __percpu_prefix "(%%rsi)\n\tsetz %0\n\t", \
X86_FEATURE_CX16, \
ASM_OUTPUT2("=a"(__ret), "=d"(__dummy)), \
"S" (&pcp1), "b"(__n1), "c"(__n2), \
"a"(__o1), "d"(__o2) : "memory"); \
__ret; \})
Just in case, the merged tree is available in the following git branch.
git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu.git merged-2.6.40
Thanks.
Eric Dumazet (1):
percpu: Avoid extra NOP in percpu_cmpxchg16b_double
Mike Frysinger (2):
percpu: Cast away printk format warning
percpu: Unify input section names
Tejun Heo (2):
percpu: Always align percpu output section to PAGE_SIZE Merge branch 'fixes-2.6.39' into for-2.6.40
arch/alpha/kernel/vmlinux.lds.S | 2 +- arch/arm/kernel/vmlinux.lds.S | 2 +- arch/blackfin/kernel/vmlinux.lds.S | 2 +- arch/cris/kernel/vmlinux.lds.S | 2 +- arch/frv/kernel/vmlinux.lds.S | 2 +- arch/m32r/kernel/vmlinux.lds.S | 2 +- arch/mips/kernel/vmlinux.lds.S | 2 +- arch/mn10300/kernel/vmlinux.lds.S | 2 +- arch/parisc/kernel/vmlinux.lds.S | 2 +- arch/powerpc/kernel/vmlinux.lds.S | 2 +- arch/s390/kernel/vmlinux.lds.S | 2 +- arch/sh/kernel/vmlinux.lds.S | 2 +- arch/sparc/kernel/vmlinux.lds.S | 2 +- arch/tile/kernel/vmlinux.lds.S | 2 +- arch/um/include/asm/common.lds.S | 2 +- arch/x86/include/asm/percpu.h | 7 +++- arch/x86/kernel/vmlinux.lds.S | 2 +- arch/xtensa/kernel/vmlinux.lds.S | 2 +- include/asm-generic/vmlinux.lds.h | 61 +++++++++++++++++++----------------- kernel/workqueue.c | 4 +-- mm/percpu.c | 6 ++- 21 files changed, 60 insertions(+), 52 deletions(-)
--
tejun