userfaultfd-hugetlbfs-add-userfaultfd_hugetlb-test.patch removed from -mm tree
The patch titled
Subject: userfaultfd: hugetlbfs: add userfaultfd_hugetlb test
has been removed from the -mm tree. Its filename was
userfaultfd-hugetlbfs-add-userfaultfd_hugetlb-test.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
From: Mike Kravetz <[email protected]>
Subject: userfaultfd: hugetlbfs: add userfaultfd_hugetlb test
Test userfaultfd hugetlb functionality by using the existing testing method (in userfaultfd.c). Instead of an anonymous memeory, a hugetlbfs file is mmap'ed private. In this way fallocate hole punch can be used to release pages. This is because madvise(MADV_DONTNEED) is not supported for huge pages.
Use the same file, but create wrappers for allocating ranges and releasing pages. Compile userfaultfd.c with HUGETLB_TEST defined to produce an executable to test userfaultfd hugetlb functionality.
---
tools/testing/selftests/vm/Makefile | 4 tools/testing/selftests/vm/run_vmtests | 13 + tools/testing/selftests/vm/userfaultfd.c | 161 ++++++++++++++++++--- 3 files changed, 161 insertions(+), 17 deletions(-)
tools/testing/selftests/vm/Makefile renamed from tools/testing/selftests/vm/Makefile~userfaultfd-hugetlbfs-add-userfaultfd_hugetlb-test +4 -0
@@ -10,6 +10,7 @@ BINARIES += on-fault-limit BINARIES += thuge-gen BINARIES += transhuge-stress BINARIES += userfaultfd +BINARIES += userfaultfd_hugetlb BINARIES += mlock-random-test all: $(BINARIES)
@@ -18,6 +19,9 @@ all: $(BINARIES) userfaultfd: userfaultfd.c ../../../../usr/include/linux/kernel.h $(CC) $(CFLAGS) -O2 -o $@ $< -lpthread +userfaultfd_hugetlb: userfaultfd.c ../../../../usr/include/linux/kernel.h + $(CC) $(CFLAGS) -DHUGETLB_TEST -O2 -o $@ $< -lpthread + mlock-random-test: mlock-random-test.c $(CC) $(CFLAGS) -o $@ $< -lcap
tools/testing/selftests/vm/run_vmtests renamed from tools/testing/selftests/vm/run_vmtests~userfaultfd-hugetlbfs-add-userfaultfd_hugetlb-test +13 -0
@@ -103,6 +103,19 @@ else echo "[PASS]" fi +echo "----------------------------" +echo "running userfaultfd_hugetlb" +echo "----------------------------" +# 258MB total huge pages == 128MB src and 128MB dst +./userfaultfd_hugetlb 128 32 $mnt/ufd_test_file +if [ $? -ne 0 ]; then + echo "[FAIL]" + exitcode=1 +else + echo "[PASS]" +fi +rm -f $mnt/ufd_test_file + #cleanup umount $mnt rm -rf $mnt
tools/testing/selftests/vm/userfaultfd.c renamed from tools/testing/selftests/vm/userfaultfd.c~userfaultfd-hugetlbfs-add-userfaultfd_hugetlb-test +144 -17
213 lines not on this page · raw message
_
Patches currently in -mm which might be from [email protected] are