From: wangfushuai <wangfushuai@baidu.com>
To: <akpm@linux-foundation.org>, <david@redhat.com>,
<andrii@kernel.org>, <osalvador@suse.de>,
<Liam.Howlett@Oracle.com>, <christophe.leroy@csgroup.eu>
Cc: <linux-kernel@vger.kernel.org>, <linux-fsdevel@vger.kernel.org>,
wangfushuai <wangfushuai@baidu.com>
Subject: [PATCH] /proc/pid/smaps: add mo info for vma in NOMMU system
Date: Sun, 8 Jun 2025 00:53:35 +0800 [thread overview]
Message-ID: <20250607165335.87054-1-wangfushuai@baidu.com> (raw)
Add mo in /proc/[pid]/smaps to indicate vma is marked VM_MAYOVERLAY,
which means the file mapping may overlay in NOMMU system.
Fixes: b6b7a8faf05c ("mm/nommu: don't use VM_MAYSHARE for MAP_PRIVATE mappings")
Signed-off-by: wangfushuai <wangfushuai@baidu.com>
---
Documentation/filesystems/proc.rst | 1 +
fs/proc/task_mmu.c | 4 ++++
2 files changed, 5 insertions(+)
diff --git a/Documentation/filesystems/proc.rst b/Documentation/filesystems/proc.rst
index 2a17865dfe39..d280594656a3 100644
--- a/Documentation/filesystems/proc.rst
+++ b/Documentation/filesystems/proc.rst
@@ -609,6 +609,7 @@ encoded manner. The codes are the following:
uw userfaultfd wr-protect tracking
ss shadow/guarded control stack page
sl sealed
+ mo may overlay file mapping
== =======================================
Note that there is no guarantee that every flag and associated mnemonic will
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 27972c0749e7..ad08807847de 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -970,7 +970,11 @@ static void show_smap_vma_flags(struct seq_file *m, struct vm_area_struct *vma)
[ilog2(VM_HUGEPAGE)] = "hg",
[ilog2(VM_NOHUGEPAGE)] = "nh",
[ilog2(VM_MERGEABLE)] = "mg",
+#ifdef CONFIG_MMU
[ilog2(VM_UFFD_MISSING)]= "um",
+#else
+ [ilog2(VM_MAYOVERLAY)] = "mo",
+#endif
[ilog2(VM_UFFD_WP)] = "uw",
#ifdef CONFIG_ARM64_MTE
[ilog2(VM_MTE)] = "mt",
--
2.36.1
next reply other threads:[~2025-06-07 16:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-07 16:53 wangfushuai [this message]
2025-06-07 17:58 ` David Hildenbrand
2025-06-07 21:18 ` Andrew Morton
2025-06-10 11:15 ` David Hildenbrand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250607165335.87054-1-wangfushuai@baidu.com \
--to=wangfushuai@baidu.com \
--cc=Liam.Howlett@Oracle.com \
--cc=akpm@linux-foundation.org \
--cc=andrii@kernel.org \
--cc=christophe.leroy@csgroup.eu \
--cc=david@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=osalvador@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®