Skip to content

locking/spinlock_debug: Change it to a mostly fair lock

Waiman Long lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 6 repliesIn review
  2. v23 patches 0 repliesSuperseded
  3. v12 patches 0 repliesSuperseded

Changes in v3 from the cover letter

- Keep the original v1 patches but move patch 3 of v2 in front so as to disable GENERIC_LOCKBREAK when DEBUG_LOCK_ALLOC is on.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3locking/spinlock: Disable GENERIC_LOCKBREAK when DEBUG_LOCK_ALLOC is onarch/m32r/Kconfig arch/parisc/Kconfig arch/powerpc/Kconfig +3 more+6 -60 replies
2/3locking/spinlock_debug: Reduce lockup suspected message clutterinclude/linux/spinlock_types.h kernel/locking/spinlock_debug.c+23 -60 replies
3/3locking/spinlock_debug: Reduce lock cacheline contentioninclude/linux/spinlock_types.h kernel/locking/spinlock_debug.c+38 -200 replies

Reviews trailers per patch

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

Read the v3 thread

Cover letter [PATCH v3 0/3] locking/spinlock_debug: Change it to a mostly fair lock

v2->v3:
- Keep the original v1 patches but move patch 3 of v2 in front so as to disable GENERIC_LOCKBREAK when DEBUG_LOCK_ALLOC is on.

v1->v2:
- Pack lockup and break_lock into a single 4-byte slot so as not to in increase spinlock size when GENERIC_LOCKBREAK is on. Hopefully that will be enough to fix a frame size too large warning in 0-day build.
- Add a new patch to disable GENERIC_LOCKBREAK when DEBUG_LOCK_ALLOC is on.

The current debug spinlock implementation is a TATAS unfair lock. This can occasionally lead to system lockup with a debug kernel because of the unfairness of the lock rather than inherent locking problem.

This patch set changes the debug spinlock implementation to a mostly fair spinlock based on the MCS lock similar to what is done in qspinlock. It also includes a patch that disable GENERIC_LOCKBREAK when DEBUG_LOCK_ALLOC is on.

Waiman Long (3):
locking/spinlock: Disable GENERIC_LOCKBREAK when DEBUG_LOCK_ALLOC is
on
locking/spinlock_debug: Reduce lockup suspected message clutter locking/spinlock_debug: Reduce lock cacheline contention

 arch/m32r/Kconfig               |  2 +-
 arch/parisc/Kconfig             |  2 +-
 arch/powerpc/Kconfig            |  2 +-
 arch/s390/Kconfig               |  2 +-
 arch/sh/Kconfig                 |  2 +-
 arch/sparc/Kconfig              |  2 +-
 include/linux/spinlock_types.h  |  8 +++--
 kernel/locking/spinlock_debug.c | 73 ++++++++++++++++++++++++++++++-----------
 8 files changed, 64 insertions(+), 29 deletions(-)
Signature · 1 line
1.8.3.1