Skip to content

RFC add our own qspinlock implementation

Nicholas Piggin linuxppc-dev 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest14 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/14powerpc/qspinlock: powerpc qspinlock implementationarch/powerpc/Kconfig arch/powerpc/include/asm/qspinlock.h arch/powerpc/include/asm/qspinlock_types.h +3 more+69 -470 replies
2/14powerpc/qspinlock: add mcs queueing for contended waitersarch/powerpc/include/asm/qspinlock.h arch/powerpc/include/asm/qspinlock_types.h arch/powerpc/lib/qspinlock.c+191 -60 replies
3/14powerpc/qspinlock: use a half-word store to unlock to avoid larx/stcx.arch/powerpc/include/asm/qspinlock.h arch/powerpc/include/asm/qspinlock_types.h+18 -70 replies
4/14powerpc/qspinlock: convert atomic operations to assemblyarch/powerpc/include/asm/qspinlock.h arch/powerpc/include/asm/qspinlock_types.h arch/powerpc/lib/qspinlock.c+79 -330 replies
5/14powerpc/qspinlock: allow new waiters to steal the lock before queueingarch/powerpc/lib/qspinlock.c+132 -110 replies
6/14powerpc/qspinlock: theft prevention to control latencyarch/powerpc/include/asm/qspinlock_types.h arch/powerpc/lib/qspinlock.c+52 -30 replies
7/14powerpc/qspinlock: store owner CPU in lock wordarch/powerpc/include/asm/qspinlock.h arch/powerpc/include/asm/qspinlock_types.h arch/powerpc/lib/qspinlock.c+20 -40 replies
8/14powerpc/qspinlock: paravirt yield to lock ownerarch/powerpc/lib/qspinlock.c+82 -110 replies
9/14powerpc/qspinlock: implement option to yield to previous nodearch/powerpc/lib/qspinlock.c+45 -10 replies
10/14powerpc/qspinlock: allow stealing when head of queue yieldsarch/powerpc/lib/qspinlock.c+45 -40 replies
11/14powerpc/qspinlock: allow propagation of yield CPU down the queuearch/powerpc/lib/qspinlock.c+98 -50 replies
12/14powerpc/qspinlock: add ability to prod new queue head CPUarch/powerpc/lib/qspinlock.c+28 -10 replies
13/14powerpc/qspinlock: trylock and initial lock attempt may stealarch/powerpc/include/asm/qspinlock.h arch/powerpc/lib/qspinlock.c+47 -10 replies
14/14powerpc/qspinlock: use spin_begin/end APIarch/powerpc/lib/qspinlock.c+17 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 00/14] add our own qspinlock implementation

The qspinlock conversion resulted in some latency regressions particularly in the paravirt (SPLPAR) case. I haven't been able to improve them much so for now I rewrite with a different paravirt algorithm (as s390 does). This isn't the same as s390 but they have some of the same concerns by the looks, so possibly if we can't unify with generic code we could unify with them at some point.

Thanks,
Nick

Nicholas Piggin (14):
powerpc/qspinlock: powerpc qspinlock implementation powerpc/qspinlock: add mcs queueing for contended waiters powerpc/qspinlock: use a half-word store to unlock to avoid larx/stcx. powerpc/qspinlock: convert atomic operations to assembly powerpc/qspinlock: allow new waiters to steal the lock before queueing powerpc/qspinlock: theft prevention to control latency powerpc/qspinlock: store owner CPU in lock word powerpc/qspinlock: paravirt yield to lock owner powerpc/qspinlock: implement option to yield to previous node powerpc/qspinlock: allow stealing when head of queue yields powerpc/qspinlock: allow propagation of yield CPU down the queue powerpc/qspinlock: add ability to prod new queue head CPU powerpc/qspinlock: trylock and initial lock attempt may steal powerpc/qspinlock: use spin_begin/end API

 arch/powerpc/Kconfig                       |   1 -
 arch/powerpc/include/asm/qspinlock.h       | 130 ++--
 arch/powerpc/include/asm/qspinlock_types.h |  65 ++
 arch/powerpc/include/asm/spinlock_types.h  |   2 +-
 arch/powerpc/lib/Makefile                  |   4 +-
 arch/powerpc/lib/qspinlock.c               | 671 +++++++++++++++++++++
 6 files changed, 829 insertions(+), 44 deletions(-)
 create mode 100644 arch/powerpc/include/asm/qspinlock_types.h
 create mode 100644 arch/powerpc/lib/qspinlock.c
Signature · 1 line
2.35.1