mirror of
https://github.com/armbian/linux-cix.git
synced 2026-01-06 12:30:45 -08:00
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:
committed by
Linus Torvalds
parent
2c5b7e1be7
commit
c47174fc36
@@ -8,10 +8,13 @@ BINARIES += hugetlbfstest
|
||||
BINARIES += map_hugetlb
|
||||
BINARIES += thuge-gen
|
||||
BINARIES += transhuge-stress
|
||||
BINARIES += userfaultfd
|
||||
|
||||
all: $(BINARIES)
|
||||
%: %.c
|
||||
$(CC) $(CFLAGS) -o $@ $^ -lrt
|
||||
userfaultfd: userfaultfd.c
|
||||
$(CC) $(CFLAGS) -O2 -o $@ $^ -lpthread
|
||||
|
||||
TEST_PROGS := run_vmtests
|
||||
TEST_FILES := $(BINARIES)
|
||||
|
||||
@@ -86,6 +86,17 @@ else
|
||||
echo "[PASS]"
|
||||
fi
|
||||
|
||||
echo "--------------------"
|
||||
echo "running userfaultfd"
|
||||
echo "--------------------"
|
||||
./userfaultfd 128 32
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "[FAIL]"
|
||||
exitcode=1
|
||||
else
|
||||
echo "[PASS]"
|
||||
fi
|
||||
|
||||
#cleanup
|
||||
umount $mnt
|
||||
rm -rf $mnt
|
||||
|
||||
636
tools/testing/selftests/vm/userfaultfd.c
Normal file
636
tools/testing/selftests/vm/userfaultfd.c
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user