linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [RFC 0/2] rwsem: introduce upgrade_read interface
@ 2024-10-16  4:35 lizhe.67
  2024-10-16  4:35 ` [RFC 1/2] " lizhe.67
                   ` (2 more replies)
  0 siblings, 3 replies; 28+ messages in thread
From: lizhe.67 @ 2024-10-16  4:35 UTC (permalink / raw)
  To: peterz, mingo, will, longman, boqun.feng, akpm
  Cc: linux-kernel, linux-mm, lizhe.67

From: Li Zhe <lizhe.67@bytedance.com>

In the current kernel rwsem implementation, there is an interface to
downgrade write lock to read lock, but there is no interface to upgrade
a read lock to write lock. This means that in order to acquire write
lock while holding read lock, we have to release the read lock first and
then acquire the write lock, which will introduce some troubles in
concurrent programming. This patch set provides the 'upgrade_read' interface
to solve this problem. This interface can change a read lock to a write
lock.

Li Zhe (2):
  rwsem: introduce upgrade_read interface
  khugepaged: use upgrade_read() to optimize collapse_huge_page

 include/linux/rwsem.h  |  1 +
 kernel/locking/rwsem.c | 87 ++++++++++++++++++++++++++++++++++++++++--
 mm/khugepaged.c        | 36 ++++++++---------
 3 files changed, 104 insertions(+), 20 deletions(-)

-- 
2.20.1



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

end of thread, other threads:[~2024-10-23  7:27 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-16  4:35 [RFC 0/2] rwsem: introduce upgrade_read interface lizhe.67
2024-10-16  4:35 ` [RFC 1/2] " lizhe.67
2024-10-16  4:56   ` Christoph Hellwig
2024-10-16  7:33     ` lizhe.67
2024-10-16  7:36       ` Christoph Hellwig
2024-10-16  8:00         ` lizhe.67
2024-10-16  8:03           ` Christoph Hellwig
2024-10-16  8:13             ` lizhe.67
2024-10-16 11:51     ` Matthew Wilcox
2024-10-16 12:21       ` Christoph Hellwig
2024-10-16 11:49   ` Matthew Wilcox
2024-10-17  6:23     ` lizhe.67
2024-10-16 14:23   ` Waiman Long
2024-10-16 18:05     ` Matthew Wilcox
2024-10-16 18:39       ` Waiman Long
2024-10-17  6:46     ` lizhe.67
2024-10-17 15:05     ` Christoph Hellwig
2024-10-17 17:36       ` Waiman Long
2024-10-18  5:06         ` Christoph Hellwig
2024-10-16  4:36 ` [RFC 2/2] khugepaged: use upgrade_read() to optimize collapse_huge_page lizhe.67
2024-10-16 11:53   ` Matthew Wilcox
2024-10-17  6:18     ` lizhe.67
2024-10-17 13:20       ` Matthew Wilcox
2024-10-18  6:37         ` lizhe.67
2024-10-23  7:27   ` kernel test robot
2024-10-16  8:09 ` [RFC 0/2] rwsem: introduce upgrade_read interface Peter Zijlstra
2024-10-16  8:53   ` lizhe.67
2024-10-16 12:10     ` Peter Zijlstra

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