]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/64s: Make POWER10 and later use pause_short in cpu_relax loops
authorNicholas Piggin <npiggin@gmail.com>
Tue, 20 Sep 2022 12:22:59 +0000 (22:22 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 28 Sep 2022 09:22:10 +0000 (19:22 +1000)
commit70dd74ca9cfc5416e2c7fede1d29acfdd7b34a17
treeb0feda9271c2502caa3e8f2b6fac5f51460a2dc3
parentcac117ac3d15d45bae1b55ee56777771e8d0a8f5
powerpc/64s: Make POWER10 and later use pause_short in cpu_relax loops

We want to move away from using SMT priority updates for cpu_relax, and
use a 'wait' instruction which is similar to x86. As well as being a
much better fit for what everybody else uses and tests with, priority
nops are stateful which is nasty (interrupts have to consider they might
be taken at a different priority), and they're expensive to execute,
similar to a mtSPR which can effect other threads in the pipe.

This has shown to give results that are less affected by code alignment
on benchmarks that cause a lot of spin waiting (e.g., rwsem contention
on unixbench filesystem benchmarks) on POWER10.

QEMU TCG only supports this instruction correctly since v7.1, versions
without the fix may cause hangs whne running POWER10 CPUs.

Reviewed-by: Segher Boessenkool <segher@kernel.crashing.org>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
[mpe: Fix checkpatch warnings RE the macros]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220920122259.363092-2-npiggin@gmail.com
arch/powerpc/include/asm/processor.h
arch/powerpc/include/asm/vdso/processor.h