core: Replace __get_cpu_var with __this_cpu_read if not used for an address.
__get_cpu_var() can be replaced with this_cpu_read and will then use a single read instruction with implied address calculation to access the correct per cpu instance. However, the address of a per cpu variable passed to __this_cpu_read() cannot be determined (since it's an implied address conversion through segment prefixes). Therefore apply this only to uses of __get_cpu_var where the address of the variable is not used. Cc: Pekka Enberg <penberg@cs.helsinki.fi> Cc: Hugh Dickins <hughd@google.com> Cc: Thomas Gleixner <tglx@linutronix.de> Acked-by:H. Peter Anvin <hpa@zytor.com> Signed-off-by:
Christoph Lameter <cl@linux.com> Signed-off-by:
Tejun Heo <tj@kernel.org>
Showing
- include/asm-generic/irq_regs.h 4 additions, 4 deletionsinclude/asm-generic/irq_regs.h
- include/linux/elevator.h 3 additions, 9 deletionsinclude/linux/elevator.h
- include/linux/kernel_stat.h 1 addition, 1 deletioninclude/linux/kernel_stat.h
- kernel/exit.c 1 addition, 1 deletionkernel/exit.c
- kernel/fork.c 1 addition, 1 deletionkernel/fork.c
- kernel/hrtimer.c 1 addition, 1 deletionkernel/hrtimer.c
- kernel/printk.c 2 additions, 2 deletionskernel/printk.c
- kernel/rcutree.c 2 additions, 2 deletionskernel/rcutree.c
- kernel/softirq.c 21 additions, 21 deletionskernel/softirq.c
- kernel/time/tick-common.c 1 addition, 1 deletionkernel/time/tick-common.c
- kernel/time/tick-oneshot.c 2 additions, 2 deletionskernel/time/tick-oneshot.c
- kernel/watchdog.c 18 additions, 18 deletionskernel/watchdog.c
- mm/slab.c 3 additions, 3 deletionsmm/slab.c
Loading
Please register or sign in to comment