]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
x86: use this_cpu_xxx to replace percpu_xxx funcs
authorAlex Shi <alex.shi@intel.com>
Tue, 20 Mar 2012 23:48:06 +0000 (10:48 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 2 Apr 2012 03:18:21 +0000 (13:18 +1000)
commitbd9ce05f6928d6c9d0c79e94345225c719cbaeb5
tree3079ab72dc103003712975383e2053484c02a5db
parent1b0745084ae875ffcc4ab177a8e3dc517a35f80a
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>
18 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.c
arch/x86/kernel/process_32.c
arch/x86/kernel/process_64.c
arch/x86/mm/tlb.c
include/linux/topology.h