mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v4 next 0/9] locking/osq_lock: Optimisations to osq_lock code
@ 2026-09-07  8:41 David Laight
  2026-09-07  8:41 ` [PATCH v4 next 1/9] locking/osq_lock: Add some comments about how it works David Laight
                   ` (9 more replies)
  0 siblings, 10 replies; 27+ messages in thread
From: David Laight @ 2026-09-07  8:41 UTC (permalink / raw)
  To: Waiman Long, Peter Zijlstra, Ingo Molnar, Will Deacon,
	Boqun Feng, linux-kernel, Linus Torvalds, Yafang Shao,
	Steven Rostedt
  Cc: David Laight

This is a continuation of some patches I wrote over two years ago.
They go a lot further and reduce the per-cpu data to a structure
that only contains two cpu numbers.

I've fixed some broken/missing memory barriers but left the initial xchg()
when acquiring the lock as a full barrier, I think it could be relaxed.

Tested with a userspace harness that can conditionally sleep at various points.

David Laight (9):
  locking/osq_lock: Add some comments about how it works
  locking/osq_lock: Save the cpu number for 'prev' not the node address
  locking/osq_lock: Set prev_cpu=0 instead of locked=1
  locking/osq_lock: Delete 'fast path' code from osq_unlock()
  locking/osq_lock: Avoid writing to node->next in the osq_lock() fast
    path
  locking/osq: Use cpu number for 'next' pointer
  locking/osq: Use 'unsigned int' for next/prev/tail
  locking/osq: inline encode_cpu() and rename decode_cpu()
  locking/osq_lock: Swap next<->prev and tail<->head

 include/linux/osq_lock.h  |  10 +-
 kernel/locking/osq_lock.c | 286 ++++++++++++++++++++------------------
 2 files changed, 154 insertions(+), 142 deletions(-)

-- 
2.39.5


^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2026-09-11 10:08 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-07  8:41 [PATCH v4 next 0/9] locking/osq_lock: Optimisations to osq_lock code David Laight
2026-09-07  8:41 ` [PATCH v4 next 1/9] locking/osq_lock: Add some comments about how it works David Laight
2026-09-09 14:57   ` Waiman Long
2026-09-07  8:41 ` [PATCH v4 next 2/9] locking/osq_lock: Save the cpu number for 'prev' not the node address David Laight
2026-09-09 17:36   ` Waiman Long
2026-09-07  8:41 ` [PATCH v4 next 3/9] locking/osq_lock: Set prev_cpu=0 instead of locked=1 David Laight
2026-09-09 18:01   ` Waiman Long
2026-09-09 18:52     ` David Laight
2026-09-07  8:41 ` [PATCH v4 next 4/9] locking/osq_lock: Delete 'fast path' code from osq_unlock() David Laight
2026-09-07  8:41 ` [PATCH v4 next 5/9] locking/osq_lock: Avoid writing to node->next in the osq_lock() fast path David Laight
2026-09-07  8:41 ` [PATCH v4 next 6/9] locking/osq: Use cpu number for 'next' pointer David Laight
2026-09-07  8:41 ` [PATCH v4 next 7/9] locking/osq: Use 'unsigned int' for next/prev/tail David Laight
2026-09-07  8:41 ` [PATCH v4 next 8/9] locking/osq: inline encode_cpu() and rename decode_cpu() David Laight
2026-09-07  8:41 ` [PATCH v4 next 9/9] locking/osq_lock: Swap next<->prev and tail<->head David Laight
2026-09-07 16:08 ` [PATCH v4 next 0/9] locking/osq_lock: Optimisations to osq_lock code Linus Torvalds
2026-09-07 17:27   ` David Laight
2026-09-09 14:15     ` Haakon Bugge
2026-09-09 19:09       ` David Laight
2026-09-09 20:14       ` Waiman Long
2026-09-09 20:33         ` Waiman Long
2026-09-10  9:45           ` Haakon Bugge
2026-09-10 11:00             ` David Laight
2026-09-10 11:31               ` Haakon Bugge
2026-09-10 12:05                 ` David Laight
2026-09-10 15:30                   ` Haakon Bugge
2026-09-10 16:22                     ` Waiman Long
2026-09-11 10:08                 ` David Laight

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®