]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
generic/{102,172,347}: Adapt test for XFS on systems with 128+CPUs + SSDs
authorLukas Herbolt <lukas@herbolt.com>
Thu, 14 May 2026 11:39:13 +0000 (13:39 +0200)
committerZorro Lang <zlang@kernel.org>
Fri, 15 May 2026 16:20:23 +0000 (00:20 +0800)
XFS will now scale by default its log size according the amount of CPUs. This
can significantly increase the log area and using hard-coded size of file size
will make the test file. Using the X percent of the free space to create the
file will let the test proceed.

For generic/102 we also have to change the 102.out as we cannot know the
amount written data and it has to be filtered out.

For generic/172 we just use the new function to calculate file big enough
to consume most of the available space.

The generic/347 will use -l concurrency=0 in case it is being run on the
XFS filesystem and mkfs.xfs already supports this option.

Signed-off-by: Lukas Herbolt <lukas@herbolt.com>
Reviewed-by: Zorro Lang <zlang@kernel.org>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/generic/102
tests/generic/102.out
tests/generic/172
tests/generic/347

index daa5061bd3fe3cdd84649cd8a8d32d5422668831..be9ddda30a1d3a56b2ec213fe8084a287b607f1f 100755 (executable)
@@ -23,12 +23,13 @@ _require_scratch
 dev_size=$((1024 * 1024 * 1024))     # 1GB filesystem
 _scratch_mkfs_sized $dev_size >>$seqres.full 2>&1
 _scratch_mount
+file_size=`_mb_pct_of_available_space $SCRATCH_DEV 80`
 
 for ((i = 0; i < 10; i++)); do
        echo "loop $i" >>$seqres.full
 
-       $XFS_IO_PROG -f -c "pwrite -b 1m 0 800m" "$SCRATCH_MNT"/file | \
-_filter_xfs_io | _filter_scratch
+       $XFS_IO_PROG -f -c "pwrite -b 1m 0 ${file_size}m" "$SCRATCH_MNT"/file | \
+_filter_xfs_io_numbers | _filter_scratch
 
        rm -f "$SCRATCH_MNT"/file
 done
index b58aa5ccc68bc8f55b0f3dac722e331d70d11914..647bb23abec17db1431578e93e305a1d07ad7cae 100644 (file)
@@ -1,21 +1,21 @@
 QA output created by 102
-wrote 838860800/838860800 bytes at offset 0
+wrote XXXX/XXXX bytes at offset XXXX
 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 838860800/838860800 bytes at offset 0
+wrote XXXX/XXXX bytes at offset XXXX
 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 838860800/838860800 bytes at offset 0
+wrote XXXX/XXXX bytes at offset XXXX
 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 838860800/838860800 bytes at offset 0
+wrote XXXX/XXXX bytes at offset XXXX
 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 838860800/838860800 bytes at offset 0
+wrote XXXX/XXXX bytes at offset XXXX
 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 838860800/838860800 bytes at offset 0
+wrote XXXX/XXXX bytes at offset XXXX
 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 838860800/838860800 bytes at offset 0
+wrote XXXX/XXXX bytes at offset XXXX
 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 838860800/838860800 bytes at offset 0
+wrote XXXX/XXXX bytes at offset XXXX
 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 838860800/838860800 bytes at offset 0
+wrote XXXX/XXXX bytes at offset XXXX
 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 838860800/838860800 bytes at offset 0
+wrote XXXX/XXXX bytes at offset XXXX
 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
index b67e817b667be545b71e9cadb8c6846b7af52ac6..06f9370f065d743e5463a4cb568a38e5b3f822f7 100755 (executable)
@@ -37,15 +37,15 @@ echo "Reformat with appropriate size"
 blksz="$(_get_block_size $testdir)"
 _scratch_unmount
 
-file_size=$((768 * 1024 * 1024))
 fs_size=$((1024 * 1024 * 1024))
 _scratch_mkfs_sized $fs_size >> $seqres.full 2>&1
 _scratch_mount >> $seqres.full 2>&1
 rm -rf $testdir
 mkdir $testdir
+file_size=`_mb_pct_of_available_space $SCRATCH_DEV 70`
 
 echo "Create a big file and reflink it"
-_pwrite_byte 0x61 0 $file_size $testdir/bigfile >> $seqres.full 2>&1
+_pwrite_byte 0x61 0 ${file_size}m $testdir/bigfile >> $seqres.full 2>&1
 _cp_reflink $testdir/bigfile $testdir/clonefile
 _scratch_sync
 
@@ -54,7 +54,7 @@ _fill_fs $fs_size  $testdir/space $blksz 0 >> $seqres.full 2>&1
 _scratch_sync
 
 echo "CoW the big file"
-out="$(_pwrite_byte 0x62 0 $file_size $testdir/bigfile 2>&1 | \
+out="$(_pwrite_byte 0x62 0 ${file_size}m $testdir/bigfile 2>&1 | \
        _filter_xfs_io_error)"
 echo ${out} | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC"
 echo ${out} >> $seqres.full 2>&1
@@ -63,7 +63,7 @@ echo ${out}
 echo "Remount and try CoW again"
 _scratch_cycle_mount
 
-out="$(_pwrite_byte 0x62 0 $file_size $testdir/bigfile 2>&1 | \
+out="$(_pwrite_byte 0x62 0 ${file_size}m $testdir/bigfile 2>&1 | \
        _filter_xfs_io_error)"
 echo ${out} | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC"
 echo ${out} >> $seqres.full 2>&1
index 5c0e3f94958524ef2585b18f173ab915f61052ca..06df0cf9eddce27572abfc87e8f31cd1efb2c9bc 100755 (executable)
@@ -14,6 +14,13 @@ BACKING_SIZE=$((500 * 1024 * 1024 / 512))    # 500M
 VIRTUAL_SIZE=$((10 * $BACKING_SIZE))           # 5000M
 GROW_SIZE=$((100 * 1024 * 1024 / 512))         # 100M
 
+dmthin_mkfs_opts=""
+if [ $FSTYP == "xfs" ]; then
+       if _scratch_mkfs_xfs_supports_concurrency -l >> $seqres.full 2>&1; then
+               dmthin_mkfs_opts="-l concurrency=0"
+       fi
+fi
+
 # Override the default cleanup function.
 _cleanup()
 {
@@ -25,7 +32,7 @@ _setup_thin()
 {
        _dmthin_init $BACKING_SIZE $VIRTUAL_SIZE
        _dmthin_set_queue
-       _dmthin_mkfs
+       _dmthin_mkfs $dmthin_mkfs_opts
        _dmthin_mount
 }