Skip to content

Commit d09a61a

Browse files
howletttehcaster
authored andcommitted
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 <[email protected]> Reviewed-by: Suren Baghdasaryan <[email protected]> Signed-off-by: Vlastimil Babka <[email protected]>
1 parent e3852a1 commit d09a61a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tools/testing/vma/vma_internal.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1373,6 +1373,8 @@ static inline void ksm_exit(struct mm_struct *mm)
13731373

13741374
static inline void vma_lock_init(struct vm_area_struct *vma, bool reset_refcnt)
13751375
{
1376+
if (reset_refcnt)
1377+
refcount_set(&vma->vm_refcnt, 0);
13761378
}
13771379

13781380
static inline void vma_numab_state_init(struct vm_area_struct *vma)

0 commit comments

Comments
 (0)