Thread (161 messages) 161 messages, 8 authors, 2025-04-24
STALE413d
Revisions (2)
  1. v3 [diff vs current]
  2. v4 current

[PATCH v4 03/39] mm: Add guard for mmap_read_lock

From: Josh Poimboeuf <jpoimboe@kernel.org>
Date: 2025-01-22 02:31:54
Also in: linux-perf-users, linux-toolchains, lkml
Subsystem: memory mapping - locking, the rest · Maintainers: Andrew Morton, Suren Baghdasaryan, Liam R. Howlett, Lorenzo Stoakes, Linus Torvalds

This is the new way of doing things.  Converting all existing
mmap_read_lock users is an exercise left for the reader ;-)

Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
---
 include/linux/mmap_lock.h | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/include/linux/mmap_lock.h b/include/linux/mmap_lock.h
index de9dc20b01ba..c971c4617060 100644
--- a/include/linux/mmap_lock.h
+++ b/include/linux/mmap_lock.h
@@ -182,4 +182,6 @@ static inline int mmap_lock_is_contended(struct mm_struct *mm)
 	return rwsem_is_contended(&mm->mmap_lock);
 }
 
+DEFINE_GUARD(mmap_read_lock, struct mm_struct *, mmap_read_lock(_T), mmap_read_unlock(_T))
+
 #endif /* _LINUX_MMAP_LOCK_H */
-- 
2.48.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help