userfaultfd: selftest

This test allocates two virtual areas and bounces the physical memory
across the two virtual areas using only userfaultfd.

Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Cc: Pavel Emelyanov <xemul@parallels.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Shuah Khan <shuah.kh@samsung.com>
Cc: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Andrea Arcangeli authored and Linus Torvalds committed 2015-09-04 16:54:41 -07:00
1 parent 2c5b7e1be7
commit c47174fc36
3 files changed
+650

No files matched your search

+3
View File
@@ -8,10 +8,13 @@ BINARIES += hugetlbfstest
BINARIES += map_hugetlb BINARIES += map_hugetlb
BINARIES += thuge-gen BINARIES += thuge-gen
BINARIES += transhuge-stress BINARIES += transhuge-stress
BINARIES += userfaultfd
all: $(BINARIES) all: $(BINARIES)
%: %.c %: %.c
$(CC) $(CFLAGS) -o $@ $^ -lrt $(CC) $(CFLAGS) -o $@ $^ -lrt
userfaultfd: userfaultfd.c
$(CC) $(CFLAGS) -O2 -o $@ $^ -lpthread
TEST_PROGS := run_vmtests TEST_PROGS := run_vmtests
TEST_FILES := $(BINARIES) TEST_FILES := $(BINARIES)
+11
View File
@@ -86,6 +86,17 @@ else
echo "[PASS]" echo "[PASS]"
fi fi
echo "--------------------"
echo "running userfaultfd"
echo "--------------------"
./userfaultfd 128 32
if [ $? -ne 0 ]; then
echo "[FAIL]"
exitcode=1
else
echo "[PASS]"
fi
#cleanup #cleanup
umount $mnt umount $mnt
rm -rf $mnt rm -rf $mnt
File diff suppressed because it is too large. Load diff