Re: [PATCH] fs/proc/task_mmu: Add display flag for VM_MAYOVERLAY

From: David Hildenbrand
Date: Thu Feb 08 2024 - 11:48:40 EST


On 08.02.24 09:48, Anshuman Khandual wrote:
VM_UFFD_MISSING flag is mutually exclussive with VM_MAYOVERLAY flag as they
both use the same bit position i.e 0x00000200 in the vm_flags. Let's update
show_smap_vma_flags() to display the correct flags depending on CONFIG_MMU.

Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Cc: David Hildenbrand <david@xxxxxxxxxx>
Cc: linux-kernel@xxxxxxxxxxxxxxx
Cc: linux-fsdevel@xxxxxxxxxxxxxxx
Signed-off-by: Anshuman Khandual <anshuman.khandual@xxxxxxx>
---
This applies on v6.8-rc3

fs/proc/task_mmu.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 3f78ebbb795f..1c4eb25cfc17 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -681,7 +681,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)] = "ov",
+#endif /* CONFIG_MMU */
[ilog2(VM_UFFD_WP)] = "uw",
#ifdef CONFIG_ARM64_MTE
[ilog2(VM_MTE)] = "mt",

Reviewed-by: David Hildenbrand <david@xxxxxxxxxx>

--
Cheers,

David / dhildenb