The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [RFC 0/1] Shrinking rwsem
@ 2026-02-17 19:08 Matthew Wilcox (Oracle)
  2026-02-17 19:08 ` [RFC 1/1] rwsem: Shrink rwsem by one pointer Matthew Wilcox (Oracle)
  0 siblings, 1 reply; 11+ messages in thread
From: Matthew Wilcox (Oracle) @ 2026-02-17 19:08 UTC (permalink / raw)
  Cc: Matthew Wilcox (Oracle), Peter Zijlstra, Ingo Molnar, Will Deacon,
	Boqun Feng, Waiman Long, linux-kernel, Linus Torvalds,
	Christoph Hellwig, linux-fsdevel

Some of Christoph's recent work has pointed out that we're achingly
close to being able to squeeze one more inode into each slab [1].
There are currently three rwsems embedded in struct inode --
invalidate_lock, i_mmap_rwsem and i_rwsem, so this saves us 24 bytes.
Of course, it'll shrink a lot of other data structures that embed
an rwsem (anon_vma and mm_struct come to mind).

We can do the same trick to struct mutex, but I thought I'd send this
out to see how people feel about the extra code complexity to make these
savings before investing any effort in doing that.

Maybe the performance bots will come back with some numbers, although
they've been weirdly sensitive to rwsem alignment in the past, so I'm
not sure I'd believe their numbers.

[1] https://lore.kernel.org/linux-fsdevel/20260202060754.270269-1-hch@lst.de/

Matthew Wilcox (Oracle) (1):
  rwsem: Shrink rwsem by one pointer

 include/linux/rwsem.h  |  8 ++---
 kernel/locking/rwsem.c | 74 +++++++++++++++++++++++++++++++-----------
 2 files changed, 59 insertions(+), 23 deletions(-)

-- 
2.47.3


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

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

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-17 19:08 [RFC 0/1] Shrinking rwsem Matthew Wilcox (Oracle)
2026-02-17 19:08 ` [RFC 1/1] rwsem: Shrink rwsem by one pointer Matthew Wilcox (Oracle)
2026-02-17 20:27   ` Linus Torvalds
2026-02-18 21:00     ` Matthew Wilcox
2026-02-18 21:37       ` Linus Torvalds
2026-02-18 22:26       ` Peter Zijlstra
2026-02-18 22:45       ` Linus Torvalds
2026-02-18 22:52         ` Linus Torvalds
2026-03-04 19:51           ` Matthew Wilcox
2026-02-18 22:47   ` Waiman Long
2026-02-18 23:06     ` Matthew Wilcox

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