]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
generic: add tests for read/writes from hugepages-backed buffers
authorJoanne Koong <joannelkoong@gmail.com>
Tue, 21 Jan 2025 21:56:41 +0000 (13:56 -0800)
committerZorro Lang <zlang@kernel.org>
Sat, 1 Feb 2025 06:04:02 +0000 (14:04 +0800)
Add generic tests 758 and 759 for testing reads/writes from buffers
backed by hugepages.

Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Zorro Lang <zlang@kernel.org>
common/rc
tests/generic/759 [new file with mode: 0755]
tests/generic/759.out [new file with mode: 0644]
tests/generic/760 [new file with mode: 0755]
tests/generic/760.out [new file with mode: 0644]

index c5421c9454fa625b673aec99bb99f312eef28273..2b71cd7ca9a7f251eb7e3ff75685799d3fbcf15c 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -3022,6 +3022,19 @@ _require_xfs_io_command()
        fi
 }
 
+# check that the system supports transparent hugepages
+_require_thp()
+{
+       if [ ! -e /sys/kernel/mm/transparent_hugepage/enabled ]; then
+               _notrun "system doesn't support transparent hugepages"
+       fi
+
+       thp_status=$(cat /sys/kernel/mm/transparent_hugepage/enabled)
+       if [[ $thp_status == *"[never]"* ]]; then
+               _notrun "system doesn't have transparent hugepages enabled"
+       fi
+}
+
 # check that kernel and filesystem support direct I/O, and check if "$1" size
 # aligned (optional) is supported
 _require_odirect()
diff --git a/tests/generic/759 b/tests/generic/759
new file mode 100755 (executable)
index 0000000..6c74478
--- /dev/null
@@ -0,0 +1,22 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+#
+# FS QA Test No. 759
+#
+# fsx exercising reads/writes from userspace buffers
+# backed by hugepages
+#
+. ./common/preamble
+_begin_fstest rw auto quick
+
+. ./common/filter
+
+_require_test
+_require_thp
+
+run_fsx -N 10000            -l 500000 -h
+run_fsx -N 10000  -o 8192   -l 500000 -h
+run_fsx -N 10000  -o 128000 -l 500000 -h
+
+status=0
+exit
diff --git a/tests/generic/759.out b/tests/generic/759.out
new file mode 100644 (file)
index 0000000..fa2b9bc
--- /dev/null
@@ -0,0 +1,4 @@
+QA output created by 759
+fsx -N 10000 -l 500000 -h
+fsx -N 10000 -o 8192 -l 500000 -h
+fsx -N 10000 -o 128000 -l 500000 -h
diff --git a/tests/generic/760 b/tests/generic/760
new file mode 100755 (executable)
index 0000000..c71a196
--- /dev/null
@@ -0,0 +1,26 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+#
+# FS QA Test No. 760
+#
+# fsx exercising direct IO reads/writes from userspace buffers
+# backed by hugepages
+#
+. ./common/preamble
+_begin_fstest rw auto quick
+
+. ./common/filter
+
+_require_test
+_require_odirect
+_require_thp
+
+psize=`$here/src/feature -s`
+bsize=`$here/src/min_dio_alignment $TEST_DIR $TEST_DEV`
+
+run_fsx -N 10000            -l 500000 -r PSIZE -t BSIZE -w BSIZE -Z -R -W -h
+run_fsx -N 10000  -o 8192   -l 500000 -r PSIZE -t BSIZE -w BSIZE -Z -R -W -h
+run_fsx -N 10000  -o 128000 -l 500000 -r PSIZE -t BSIZE -w BSIZE -Z -R -W -h
+
+status=0
+exit
diff --git a/tests/generic/760.out b/tests/generic/760.out
new file mode 100644 (file)
index 0000000..320a9f6
--- /dev/null
@@ -0,0 +1,4 @@
+QA output created by 760
+fsx -N 10000 -l 500000 -r PSIZE -t BSIZE -w BSIZE -Z -R -W -h
+fsx -N 10000 -o 8192 -l 500000 -r PSIZE -t BSIZE -w BSIZE -Z -R -W -h
+fsx -N 10000 -o 128000 -l 500000 -r PSIZE -t BSIZE -w BSIZE -Z -R -W -h