[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250124235454.84587-11-anthony.yznaga@oracle.com>
Date: Fri, 24 Jan 2025 15:54:44 -0800
From: Anthony Yznaga <anthony.yznaga@...cle.com>
To: akpm@...ux-foundation.org, willy@...radead.org, markhemm@...glemail.com,
viro@...iv.linux.org.uk, david@...hat.com, khalid@...nel.org
Cc: anthony.yznaga@...cle.com, jthoughton@...gle.com, corbet@....net,
dave.hansen@...el.com, kirill@...temov.name, luto@...nel.org,
brauner@...nel.org, arnd@...db.de, ebiederm@...ssion.com,
catalin.marinas@....com, mingo@...hat.com, peterz@...radead.org,
liam.howlett@...cle.com, lorenzo.stoakes@...cle.com, vbabka@...e.cz,
jannh@...gle.com, hannes@...xchg.org, mhocko@...nel.org,
roman.gushchin@...ux.dev, shakeel.butt@...ux.dev,
muchun.song@...ux.dev, tglx@...utronix.de, cgroups@...r.kernel.org,
x86@...nel.org, linux-doc@...r.kernel.org, linux-arch@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-mm@...ck.org, mhiramat@...nel.org,
rostedt@...dmis.org, vasily.averin@...ux.dev, xhao@...ux.alibaba.com,
pcc@...gle.com, neilb@...e.de, maz@...nel.org
Subject: [PATCH 10/20] mm: add mmap_read_lock_killable_nested()
This will be used to support mshare functionality where the read
lock on an mshare host mm is taken while holding the lock on a
process mm.
Signed-off-by: Anthony Yznaga <anthony.yznaga@...cle.com>
---
include/linux/mmap_lock.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/include/linux/mmap_lock.h b/include/linux/mmap_lock.h
index 45a21faa3ff6..4671b4435d2a 100644
--- a/include/linux/mmap_lock.h
+++ b/include/linux/mmap_lock.h
@@ -191,6 +191,13 @@ static inline void mmap_read_lock(struct mm_struct *mm)
__mmap_lock_trace_acquire_returned(mm, false, true);
}
+static inline void mmap_read_lock_nested(struct mm_struct *mm, int subclass)
+{
+ __mmap_lock_trace_start_locking(mm, false);
+ down_read_nested(&mm->mmap_lock, subclass);
+ __mmap_lock_trace_acquire_returned(mm, false, true);
+}
+
static inline int mmap_read_lock_killable(struct mm_struct *mm)
{
int ret;
--
2.43.5
Powered by blists - more mailing lists