mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: wangfushuai <wangfushuai@baidu.com>,
	akpm@linux-foundation.org, 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
Subject: Re: [PATCH] /proc/pid/smaps: add mo info for vma in NOMMU system
Date: Sat, 7 Jun 2025 19:58:58 +0200	[thread overview]
Message-ID: <e4d9e46d-37c7-478d-b543-07ac91413e5b@redhat.com> (raw)
In-Reply-To: <20250607165335.87054-1-wangfushuai@baidu.com>

On 07.06.25 18:53, wangfushuai wrote:
> 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",

That is mostly an internal-only flag. Why would we want to expose that 
to user space?

-- 
Cheers,

David / dhildenb


  reply	other threads:[~2025-06-07 17:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-07 16:53 wangfushuai
2025-06-07 17:58 ` David Hildenbrand [this message]
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=e4d9e46d-37c7-478d-b543-07ac91413e5b@redhat.com \
    --to=david@redhat.com \
    --cc=Liam.Howlett@Oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=andrii@kernel.org \
    --cc=christophe.leroy@csgroup.eu \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=osalvador@suse.de \
    --cc=wangfushuai@baidu.com \
    /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®