linux-stable/include
Nicholas Piggin 1b5ca12127 percpu: improve generic percpu modify-return implementation
Some architectures require an additional load to find the address of
percpu pointers. In some implemenatations, the C aliasing rules do not
allow the result of that load to be kept over the store that modifies
the percpu variable, which causes additional loads.

Work around this by finding the pointer first, then operating on that.

It's also possible to mark things as restrict and those kind of games,
but that can require larger and arch specific changes.

On powerpc, __this_cpu_inc_return compiles to:

        ld 10,48(13)
        ldx 9,3,10
        addi 9,9,1
        stdx 9,3,10
        ld 9,48(13)
        ldx 3,9,3

With this patch it compiles to:

        ld 10,48(13)
        ldx 9,3,10
        addi 9,9,1
        stdx 9,3,10

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
To: Tejun Heo <tj@kernel.org>
To: Christoph Lameter <cl@linux.com>
Cc: linux-kernel@vger.kernel.org
Cc: linux-arch@vger.kernel.org
Signed-off-by: Tejun Heo <tj@kernel.org>
2016-09-22 12:06:53 -04:00
..
acpi treewide: replace obsolete _refok by __ref 2016-08-02 17:31:41 -04:00
asm-generic percpu: improve generic percpu modify-return implementation 2016-09-22 12:06:53 -04:00
clocksource
crypto A number of improvements for the /dev/random driver; the most 2016-07-27 15:11:55 -07:00
drm Merge branch 'generic-zpos-v8' of http://git.linaro.org/people/benjamin.gaignard/kernel into drm-next 2016-08-03 08:40:24 +10:00
dt-bindings ARM: DT updates for v4.8 2016-08-01 18:37:45 -04:00
keys
kvm KVM/ARM Changes for v4.8 - Take 2 2016-08-04 13:59:56 +02:00
linux Implements HARDENED_USERCOPY verification of copy_to_user/copy_from_user 2016-08-08 14:48:14 -07:00
math-emu
media dma-mapping: use unsigned long for dma_attrs 2016-08-04 08:50:07 -04:00
memory
misc
net virtio/vhost: new features for 4.8 2016-08-06 09:20:13 -04:00
pcmcia
ras
rdma Second round of merge items for 4.8 2016-08-04 20:26:31 -04:00
rxrpc
scsi Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2016-08-04 20:04:37 -04:00
soc ARM: SoC driver updates for v4.8 2016-08-01 18:36:01 -04:00
sound Merge tag 'drm-for-v4.8' of git://people.freedesktop.org/~airlied/linux 2016-08-01 21:44:08 -04:00
target
trace block: rename bio bi_rw to bi_opf 2016-08-07 14:41:02 -06:00
uapi virtio/vhost: new features for 4.8 2016-08-06 09:20:13 -04:00
video
xen dma-mapping: use unsigned long for dma_attrs 2016-08-04 08:50:07 -04:00
Kbuild