ndctl: dax pmd tests
Subsystems (4)
PATCH 1/1 ndctl: dax pmd tests
Check the following conditions:
1/ gup fault
2/ gup fast
3/ copying a huge mapping on fork()
Cc Jan Kara <[email protected]>
Cc Dave Chinner <[email protected]>
Cc Matthew Wilcox <[email protected]>
Cc Ross Zwisler <[email protected]>
Signed-off-by Dan Williams <[email protected]>
---
This is the test case used to generate the kernel crash signatures mentioned in "[PATCH 2/8] dax: disable pmd mappings":
https://lists.01.org/pipermail/linux-nvdimm/2015-November/002875.html
Makefile.am | 8 ++ lib/test-dax-dev.c | 96 +++++++++++++++++++++++++++++ lib/test-dax-pmd.c | 172 ++++++++++++++++++++++++++++++++++++++++++++++++++++ lib/test-dax.sh | 34 ++++++++++ 4 files changed, 310 insertions(+) create mode 100755 lib/test-dax-dev.c create mode 100644 lib/test-dax-pmd.c create mode 100755 lib/test-dax.sh
Makefile.am +8 -0
@@ -122,6 +122,9 @@ check_PROGRAMS = lib/test-libndctl lib/test-dpa-alloc lib/test-parent-uuid if ENABLE_DESTRUCTIVE TESTS += lib/test-blk-ns lib/test-pmem-ns lib/test-pcommit check_PROGRAMS += lib/test-blk-ns lib/test-pmem-ns lib/test-pcommit + +TESTS += lib/test-dax-dev lib/test-dax.sh +check_PROGRAMS += lib/test-dax-dev lib/test-dax-pmd endif lib_test_libndctl_SOURCES = lib/test-libndctl.c lib/test-core.c
@@ -141,3 +144,8 @@ lib_test_dpa_alloc_LDADD = lib/libndctl.la $(UUID_LIBS) $(KMOD_LIBS) lib_test_parent_uuid_SOURCES = lib/test-parent-uuid.c lib/test-core.c lib_test_parent_uuid_LDADD = lib/libndctl.la $(UUID_LIBS) $(KMOD_LIBS) + +lib_test_dax_dev_SOURCES = lib/test-dax-dev.c lib/test-core.c +lib_test_dax_dev_LDADD = lib/libndctl.la + +lib_test_dax_pmd_SOURCES = lib/test-dax-pmd.c
lib/test-dax-dev.c new file +96 -0
96 lines not on this page · raw message
lib/test-dax-pmd.c new file +172 -0
172 lines not on this page · raw message
lib/test-dax.sh new file +34 -0
@@ -0,0 +1,34 @@ +#!/bin/bash +MNT=test_dax_mnt +FILE=image +DEV="" + +err() { + rc=1 + echo "test-dax: failed at line $1" + if [ -n "$DEV" ]; then + umount $DEV + else + rc=77 + fi + rmdir $MNT + exit $rc +} + +set -e +mkdir -p $MNT +trap 'err $LINENO' ERR + +DEV=$(lib/test-dax-dev) + +mkfs.ext4 $DEV +mount $DEV $MNT -o dax +fallocate -l 1GiB $MNT/$FILE +lib/test-dax-pmd $MNT/$FILE +umount $MNT + +mkfs.xfs -f $DEV +mount $DEV $MNT -o dax +fallocate -l 1GiB $MNT/$FILE +lib/test-dax-pmd $MNT/$FILE +umount $MNT