Skip to content

Commit 64527f5

Browse files
rppttorvalds
authored andcommitted
userfaultfd: non-cooperative: selftest: enable REMOVE event test for shmem
Now when madvise(MADV_REMOVE) notifies uffd reader, we should verify that appliciation actually sees zeros at the removed range. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Mike Rapoport <[email protected]> Reviewed-by: Andrea Arcangeli <[email protected]> Cc: Hillf Danton <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent a6bf53e commit 64527f5

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

tools/testing/selftests/vm/userfaultfd.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -569,9 +569,9 @@ static int userfaultfd_open(int features)
569569
* part is accessed after mremap. Since hugetlbfs does not support
570570
* mremap, the entire monitored area is accessed in a single pass for
571571
* HUGETLB_TEST.
572-
* The release of the pages currently generates event only for
572+
* The release of the pages currently generates event for shmem and
573573
* anonymous memory (UFFD_EVENT_REMOVE), hence it is not checked
574-
* for hugetlb and shmem.
574+
* for hugetlb.
575575
*/
576576
static int faulting_process(void)
577577
{
@@ -610,15 +610,13 @@ static int faulting_process(void)
610610
}
611611
}
612612

613-
#ifndef SHMEM_TEST
614613
if (release_pages(area_dst))
615614
return 1;
616615

617616
for (nr = 0; nr < nr_pages; nr++) {
618617
if (my_bcmp(area_dst + nr * page_size, zeropage, page_size))
619618
fprintf(stderr, "nr %lu is not zero\n", nr), exit(1);
620619
}
621-
#endif /* SHMEM_TEST */
622620

623621
#endif /* HUGETLB_TEST */
624622

0 commit comments

Comments
 (0)