summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/perf
diff options
context:
space:
mode:
authorMadhavan Srinivasan2017-12-20 04:55:57 +0100
committerMichael Ellerman2018-01-19 12:37:04 +0100
commit6cd74d2b6174957103c8f6f2cfcefe086a51e6eb (patch)
tree8f19bc213be4efadc4c1d6eb2845d8c6e6fa0baa /arch/powerpc/perf
parentpowerpc: use generic atomic implementation for local_t (diff)
downloadkernel-qcow2-linux-6cd74d2b6174957103c8f6f2cfcefe086a51e6eb.tar.gz
kernel-qcow2-linux-6cd74d2b6174957103c8f6f2cfcefe086a51e6eb.tar.xz
kernel-qcow2-linux-6cd74d2b6174957103c8f6f2cfcefe086a51e6eb.zip
powerpc/64s: Implement local_t using irq soft masking
local_t is used for atomic modifications for per-CPU data, versus re-entrant modifications via interrupts. local_t read-modify-write atomic operations are currently implemented with hardware atomics (larx/stcx), which are quite slow. This patch implements them by masking all types of interrupts that may do local_t operations ("standard" and perf interrupts). Rusty's benchmark (https://lkml.org/lkml/2008/12/16/450) gives the following timings for the local_t test, in nanoseconds per iteration: larx/stcx irq+pmu disable _inc 38 10 _add 38 10 _read 4 4 _add_return 38 10 There are still some interrupt types (system reset, machine check, and watchdog), which can not safely use local_t operations, because they are not masked. An alternative approach was proposed, using a CR bit to mark a critical section, which is tested in the interrupt return path, and would then branch to a fixup handler (similar to exception fixups), which re-starts the operation. The problem with this was the complexity of the fixup handler and the latency of the slow path. https://lists.ozlabs.org/pipermail/linuxppc-dev/2014-November/123024.html Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/perf')
0 files changed, 0 insertions, 0 deletions