diff options
author | Liam R. Howlett <Liam.Howlett@oracle.com> | 2025-09-03 14:59:52 +0200 |
---|---|---|
committer | Vlastimil Babka <vbabka@suse.cz> | 2025-09-29 09:21:16 +0200 |
commit | d09a61a3aa7de53fe055743993d79eaeb945cbad (patch) | |
tree | a01564d868bd92c95a0a7b253f2f97bd78f9578f | |
parent | e3852a1213ffc6fbd89c768e7c54a360652648b8 (diff) |
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>
-rw-r--r-- | tools/testing/vma/vma_internal.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/testing/vma/vma_internal.h b/tools/testing/vma/vma_internal.h index f8cf5b184d5b..6b6e2b05918c 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) |