]> git.karo-electronics.de Git - karo-tx-linux.git/commit
x86: use this_cpu_xxx to replace percpu_xxx funcs
authorAlex Shi <alex.shi@intel.com>
Thu, 3 May 2012 05:43:17 +0000 (15:43 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 3 May 2012 05:46:15 +0000 (15:46 +1000)
commit13030371cc00277a6b9fa609982ab5507b43db1d
treeacdd118418e1125459bf54536c7a37e0fa8e249f
parent2b31b802738f0551dd7fef6f38a74d1851ca20ad
x86: use this_cpu_xxx to replace percpu_xxx funcs

Since percpu_xxx() serial functions are duplicate with this_cpu_xxx().
Removing percpu_xxx() definition and replacing them by this_cpu_xxx() in
code.

And further more, as Christoph Lameter's requirement, I try to use
__this_cpu_xx to replace this_cpu_xxx if it is in preempt safe scenario.
The preempt safe scenarios include:
1, in irq/softirq/nmi handler
2, protected by preempt_disable
3, protected by spin_lock
4, if the code context imply that it is preempt safe, like the code is
follows or be followed a preempt safe code.

BTW, In fact, this_cpu_xxx are same as __this_cpu_xxx since all funcs
implement in a single instruction for x86 machine.  But it maybe other
platforms' performance.

[akpm@linux-foundation.org: fix build]
[sfr@canb.auug.org.au: arch/x86/include/asm/desc.h: fix smp_processor_id's need for this_cpu_read]
Signed-off-by: Alex Shi <alex.shi@intel.com>
Acked-by: Christoph Lameter <cl@gentwo.org>
Acked-by: Tejun Heo <tj@kernel.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
17 files changed:
arch/x86/include/asm/desc.h
arch/x86/include/asm/hardirq.h
arch/x86/include/asm/irq_regs.h
arch/x86/include/asm/mmu_context.h
arch/x86/include/asm/percpu.h
arch/x86/include/asm/smp.h
arch/x86/include/asm/stackprotector.h
arch/x86/include/asm/tlbflush.h
arch/x86/kernel/cpu/common.c
arch/x86/kernel/cpu/mcheck/mce.c
arch/x86/kernel/i387.c
arch/x86/kernel/nmi_selftest.c
arch/x86/kernel/paravirt.c
arch/x86/kernel/process_32.c
arch/x86/kernel/process_64.c
arch/x86/mm/tlb.c
include/linux/topology.h