diff options
author | Nicholas Piggin <npiggin@gmail.com> | 2016-09-22 11:55:54 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2016-09-22 12:06:53 -0400 |
commit | 1b5ca12127427c51be605a75ecd0141eb3357249 (patch) | |
tree | 5181f24d2ff40d73916a9d7aba9b2315bd01ad21 /drivers/firewire | |
parent | a67823c1ed1092160da94c31e6da5aeb35dca81c (diff) | |
download | linux-1b5ca12127427c51be605a75ecd0141eb3357249.tar.gz linux-1b5ca12127427c51be605a75ecd0141eb3357249.tar.bz2 linux-1b5ca12127427c51be605a75ecd0141eb3357249.zip |
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>
Diffstat (limited to 'drivers/firewire')
0 files changed, 0 insertions, 0 deletions