tools/testing/vma: Implement vm_refcnt reset

Add the reset of the ref count in vma_lock_init().  This is needed if
the vma memory is not zeroed on allocation.

Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Reviewed-by: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
This commit is contained in:
Liam R. Howlett 2025-09-03 14:59:52 +02:00 committed by Vlastimil Babka
parent e3852a1213
commit d09a61a3aa
1 changed files with 2 additions and 0 deletions

View File

@ -1373,6 +1373,8 @@ static inline void ksm_exit(struct mm_struct *mm)
static inline void vma_lock_init(struct vm_area_struct *vma, bool reset_refcnt)
{
if (reset_refcnt)
refcount_set(&vma->vm_refcnt, 0);
}
static inline void vma_numab_state_init(struct vm_area_struct *vma)