Re: [PATCH] /proc/pid/smaps: add mo info for vma in NOMMU system
From: Andrew Morton
Date: Sat Jun 07 2025 - 17:19:10 EST
On Sun, 8 Jun 2025 00:53:35 +0800 wangfushuai <wangfushuai@xxxxxxxxx> 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")
In what sense does this "fix" b6b7a8faf05c? Which, after all, said "no
functional change intended".
It does appear to be an improvement to the NOMMU user interface.
However it is non-backward-compatible - perhaps there's existing
userspace which is looking for "um" and which now needs to be changed
to look for "mo".
We could prevent this by continiing to show "um" on CONFIG_MMU and
additionally showing the new "mo". If we do this, let's have a code
comment in show_smap_vma_flags() explaining why the code is this way.