From: Liam R. Howlett Date: Wed, 3 Sep 2025 12:59:52 +0000 (+0200) Subject: tools/testing/vma: Implement vm_refcnt reset X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d09a61a3aa7de53fe055743993d79eaeb945cbad;p=thirdparty%2Fkernel%2Fstable.git 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 Reviewed-by: Suren Baghdasaryan Signed-off-by: Vlastimil Babka --- diff --git a/tools/testing/vma/vma_internal.h b/tools/testing/vma/vma_internal.h index f8cf5b184d5b5..6b6e2b05918c9 100644 --- a/tools/testing/vma/vma_internal.h +++ b/tools/testing/vma/vma_internal.h @@ -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)