aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMike Rapoport <rppt@linux.vnet.ibm.com>2017-02-24 17:56:08 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2017-02-24 20:46:54 -0500
commit64527f5d540ad496718c7bca5e9387cf6cf94e8c (patch)
tree2e11d8dcee33d556ad163b3f6ecd4847ce5e259b /tools
parenta6bf53eba98e0c36f51322cd6aa771c0ffa283f3 (diff)
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/1484814154-1557-4-git-send-email-rppt@linux.vnet.ibm.com Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com> Reviewed-by: Andrea Arcangeli <aarcange@redhat.com> Cc: Hillf Danton <hillf.zj@alibaba-inc.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/vm/userfaultfd.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/tools/testing/selftests/vm/userfaultfd.c b/tools/testing/selftests/vm/userfaultfd.c
index 9eb77df568f7..e9449c801888 100644
--- a/tools/testing/selftests/vm/userfaultfd.c
+++ b/tools/testing/selftests/vm/userfaultfd.c
@@ -569,9 +569,9 @@ static int userfaultfd_open(int features)
569 * part is accessed after mremap. Since hugetlbfs does not support 569 * part is accessed after mremap. Since hugetlbfs does not support
570 * mremap, the entire monitored area is accessed in a single pass for 570 * mremap, the entire monitored area is accessed in a single pass for
571 * HUGETLB_TEST. 571 * 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
573 * anonymous memory (UFFD_EVENT_REMOVE), hence it is not checked 573 * anonymous memory (UFFD_EVENT_REMOVE), hence it is not checked
574 * for hugetlb and shmem. 574 * for hugetlb.
575 */ 575 */
576static int faulting_process(void) 576static int faulting_process(void)
577{ 577{
@@ -610,7 +610,6 @@ static int faulting_process(void)
610 } 610 }
611 } 611 }
612 612
613#ifndef SHMEM_TEST
614 if (release_pages(area_dst)) 613 if (release_pages(area_dst))
615 return 1; 614 return 1;
616 615
@@ -618,7 +617,6 @@ static int faulting_process(void)
618 if (my_bcmp(area_dst + nr * page_size, zeropage, page_size)) 617 if (my_bcmp(area_dst + nr * page_size, zeropage, page_size))
619 fprintf(stderr, "nr %lu is not zero\n", nr), exit(1); 618 fprintf(stderr, "nr %lu is not zero\n", nr), exit(1);
620 } 619 }
621#endif /* SHMEM_TEST */
622 620
623#endif /* HUGETLB_TEST */ 621#endif /* HUGETLB_TEST */
624 622