Re: [PATCH v2 4/7] mm: rename mm_struct::map_count to vma_count
From: David Hildenbrand
Date: Wed Sep 17 2025 - 09:51:45 EST
On 15.09.25 18:36, Kalesh Singh wrote:
A mechanical rename of the mm_struct->map_count field to
vma_count; no functional change is intended.
The name "map_count" is ambiguous within the memory management subsystem,
as it can be confused with the folio/page->_mapcount field, which tracks
PTE references.
The new name, vma_count, is more precise as this field has always
counted the number of vm_area_structs associated with an mm_struct.
Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Cc: David Hildenbrand <david@xxxxxxxxxx>
Cc: "Liam R. Howlett" <Liam.Howlett@xxxxxxxxxx>
Cc: Lorenzo Stoakes <lorenzo.stoakes@xxxxxxxxxx>
Cc: Mike Rapoport <rppt@xxxxxxxxxx>
Cc: Minchan Kim <minchan@xxxxxxxxxx>
Cc: Pedro Falcato <pfalcato@xxxxxxx>
Signed-off-by: Kalesh Singh <kaleshsingh@xxxxxxxxxx>
---
[...]
+++ b/mm/mmap.c
@@ -1308,7 +1308,7 @@ void exit_mmap(struct mm_struct *mm)
vma = vma_next(&vmi);
} while (vma && likely(!xa_is_zero(vma)));
- BUG_ON(count != mm->map_count);
+ BUG_ON(count != mm->vma_count);
While at it, best to change that to a WARN_ON_ONCE() or even a VM_WARN_ON_ONCE().
[ or remove it -- have we ever seen that firing? ]
Acked-by: David Hildenbrand <david@xxxxxxxxxx>
--
Cheers
David / dhildenb