mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/3] Shrink size of sleeping locks
@ 2026-03-05 19:55 Matthew Wilcox (Oracle)
  2026-03-05 19:55 ` [PATCH 1/3] rwsem: Remove the list_head from struct rw_semaphore Matthew Wilcox (Oracle)
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Matthew Wilcox (Oracle) @ 2026-03-05 19:55 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Matthew Wilcox (Oracle),
	Ingo Molnar, Will Deacon, Boqun Feng, Waiman Long, linux-kernel

This series shrinks the mutex, semaphore and rw_semaphore by one pointer
by changing the list_head to a pointer to the first waiter.  Some sample
savings with the Debian config:

task_struct 5696 to 5632 bytes (89 to 88 cache lines)
mm_struct 1728 to 1600 bytes (27 to 25 cache lines)
mm_mm_cid 192 to 128 bytes (3 to 2 cache lines)
file 184 to 176 bytes (from 22 objects per 4kB slab to 23)
inode 608 to 584 bytes (from 13 objects per 8kB slab to 14)

Changes from RFC:

 - Added patches for semaphore & mutex
 - Undid inadvertent change to rwsem_del_wake_waiter()
 - Attempted to follow Peter's preferred coding style

Matthew Wilcox (Oracle) (3):
  rwsem: Remove the list_head from struct rw_semaphore
  semaphore: Remove the list_head from struct semaphore
  mutex: Remove the list_head from struct mutex

 drivers/acpi/osl.c           |  2 +-
 include/linux/mutex.h        |  2 +-
 include/linux/mutex_types.h  |  2 +-
 include/linux/rwsem.h        |  8 ++--
 include/linux/semaphore.h    |  4 +-
 kernel/locking/mutex-debug.c |  5 +-
 kernel/locking/mutex.c       | 49 +++++++++++---------
 kernel/locking/rwsem.c       | 89 +++++++++++++++++++++++-------------
 kernel/locking/semaphore.c   | 41 +++++++++++++----
 kernel/locking/ww_mutex.h    | 25 +++-------
 10 files changed, 132 insertions(+), 95 deletions(-)

-- 
2.47.3


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

end of thread, other threads:[~2026-03-19 13:47 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-05 19:55 [PATCH 0/3] Shrink size of sleeping locks Matthew Wilcox (Oracle)
2026-03-05 19:55 ` [PATCH 1/3] rwsem: Remove the list_head from struct rw_semaphore Matthew Wilcox (Oracle)
2026-03-09 19:48   ` [tip: locking/core] locking/rwsem: " tip-bot2 for Matthew Wilcox (Oracle)
2026-03-14  0:03     ` Andrei Vagin
2026-03-18 19:07   ` [PATCH 1/3] rwsem: " Mark Brown
2026-03-18 20:28     ` Peter Zijlstra
2026-03-19 13:47       ` Mark Brown
2026-03-05 19:55 ` [PATCH 2/3] semaphore: Remove the list_head from struct semaphore Matthew Wilcox (Oracle)
2026-03-09 19:48   ` [tip: locking/core] locking/semaphore: " tip-bot2 for Matthew Wilcox (Oracle)
2026-03-05 19:55 ` [PATCH 3/3] mutex: Remove the list_head from struct mutex Matthew Wilcox (Oracle)
2026-03-07  0:30   ` kernel test robot
2026-03-09 19:48   ` [tip: locking/core] locking/mutex: " tip-bot2 for Matthew Wilcox (Oracle)
2026-03-06 10:14 ` [PATCH 0/3] Shrink size of sleeping locks Peter Zijlstra
2026-03-09 19:48   ` [tip: locking/core] locking/rwsem: Add context analysis tip-bot2 for Peter Zijlstra

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®