powerpc/qspinlock: use a half-word store to unlock to avoid larx/stcx.
authorNicholas Piggin <npiggin@gmail.com>
Sat, 26 Nov 2022 09:59:17 +0000 (19:59 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 2 Dec 2022 06:48:49 +0000 (17:48 +1100)
commit4c93c2e4b9e8988511c06b9c042f23d4b8f593ad
tree7e8f54d808a17fd46eb79d5f43d228b6af175af0
parent84990b169557428c318df87b7836cd15f65b62dc
powerpc/qspinlock: use a half-word store to unlock to avoid larx/stcx.

The first 16 bits of the lock are only modified by the owner, and other
modifications always use atomic operations on the entire 32 bits, so
unlocks can use plain stores on the 16 bits. This is the same kind of
optimisation done by core qspinlock code.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20221126095932.1234527-3-npiggin@gmail.com
arch/powerpc/include/asm/qspinlock.h
arch/powerpc/include/asm/qspinlock_types.h