]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
fstests: scale some tests for high CPU count sanity
authorDave Chinner <dchinner@redhat.com>
Tue, 26 Nov 2024 21:00:55 +0000 (08:00 +1100)
committerZorro Lang <zlang@kernel.org>
Sun, 8 Dec 2024 14:12:58 +0000 (22:12 +0800)
Several tests use lots of processes to stress the filesystem. many
of them haven't really considered what this means for running the
test on high CPU machines (e.g. >32p) and the potential contention
and performance issues this might trigger.

Some of these tests simply need to increase the size of the journal.
Some need to run on filesystems with high inherent concurrency (e.g.
larger AG count). Some need more efficient/faster file creation. And
so on.

This commit is a collection of those sorts of changes to improve
runtimes on high CPU count machines.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Zorro lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
src/aio-dio-regress/aio-last-ref-held-by-io.c
tests/generic/323
tests/generic/530
tests/generic/531
tests/xfs/013
tests/xfs/076
tests/xfs/176
tests/xfs/297
tests/xfs/501
tests/xfs/502

index a70f2a9b7de83803f2027b8eecf73640289da904..7106e30a93b9119429c1d64211529f286ad96807 100644 (file)
@@ -85,11 +85,14 @@ aio_test_thread(void *data)
        /*
         * Problems have been easier to trigger when spreading the
         * workload over the available CPUs.
+        *
+        * If CPU hotplug is active, this can randomly fail so dump the error
+        * to stderror so it can be filtered out easily by the caller.
         */
        CPU_ZERO(&cpuset);
        CPU_SET(mycpu, &cpuset);
        if (sched_setaffinity(mytid, sizeof(cpuset), &cpuset)) {
-               printf("FAILED to set thread %d to run on cpu %ld\n",
+               fprintf(stderr, "FAILED to set thread %d to run on cpu %ld\n",
                       mytid, mycpu);
        }
 
index 457253fee82ca3fd67f935714af742451355a2fe..2dde04d064395ae2f77680d8190c0ad2748673d2 100755 (executable)
@@ -23,12 +23,15 @@ _require_aiodio aio-last-ref-held-by-io
 testfile=$TEST_DIR/aio-testfile
 $XFS_IO_PROG -ftc "pwrite 0 10m" $testfile | _filter_xfs_io
 
-$AIO_TEST 0 100 $testfile
+# This can emit cpu affinity setting failures that aren't considered test
+# failures but cause golden image failures. Redirect the test output to
+# $seqres.full so that it is captured but doesn't directly cause test failures.
+$AIO_TEST 0 100 $testfile 2>> $seqres.full
 if [ $? -ne 0 ]; then
        exit $status
 fi
 
-$AIO_TEST 1 100 $testfile
+$AIO_TEST 1 100 $testfile 2>> $seqres.full
 if [ $? -ne 0 ]; then
        exit $status
 fi
index 2e47c3e0c20c80753d4994a58de3242c42261ab1..18256b870b53696cfba5facc1da8d69182c84026 100755 (executable)
@@ -22,7 +22,7 @@ _require_scratch_shutdown
 _require_metadata_journaling
 _require_test_program "t_open_tmpfiles"
 
-_scratch_mkfs >> $seqres.full 2>&1
+_scratch_mkfs "-l size=256m" >> $seqres.full 2>&1
 _scratch_mount
 
 # Set ULIMIT_NOFILE to min(file-max / 2, 50000 files per LOAD_FACTOR)
index 0e3564fd46c5ffd2ea13e0171f621bd9b15d65c2..ed6c3f91153ecc66fda77207615bcf4df2808e21 100755 (executable)
@@ -21,7 +21,13 @@ _require_scratch
 _require_xfs_io_command "-T"
 _require_test_program "t_open_tmpfiles"
 
-_scratch_mkfs >> $seqres.full 2>&1
+# On high CPU count machines, this runs a -lot- of create and unlink
+# concurrency. Set the filesytsem up to handle this.
+if [ $FSTYP = "xfs" ]; then
+       _scratch_mkfs "-d agcount=32" >> $seqres.full 2>&1
+else
+       _scratch_mkfs >> $seqres.full 2>&1
+fi
 _scratch_mount
 
 # Try to load up all the CPUs, two threads per CPU.
index fd3d8c64cd30b23892025156f49771ff1b235609..5a92ef084528f334b8e33c547c1ecaabb7233409 100755 (executable)
@@ -28,7 +28,7 @@ _create()
        mkdir -p $dir
        for i in $(seq 0 $count)
        do
-               touch $dir/$i 2>&1 | filter_enospc
+               echo -n > $dir/$i 2>&1 | filter_enospc
        done
 }
 
@@ -42,7 +42,7 @@ _rand_replace()
        do
                file=$((RANDOM % count))
                rm -f $dir/$file
-               touch $dir/$file 2>&1 | filter_enospc
+               echo -n > $dir/$file 2>&1 | filter_enospc
        done
 }
 
index 840617ccb89c334214c6b74c8b96ce0304f21a46..e315a067c85de282829ebca09ee07b05001e03f0 100755 (executable)
@@ -47,10 +47,10 @@ _alloc_inodes()
        dir=$1
 
        i=0
-       while [ true ]; do
-               touch $dir/$i 2>> $seqres.full || break
+       while [ true ]; do
+               echo -n > $dir/$i || break
                i=$((i + 1))
-       done
+       done ) >> $seqres.full 2>&1
 }
 
 
index 8e5951ec1d6647f1a6af69ab68fd5391afb4c830..1aa8cde3807116aa74f122b6327b8408b51e3a64 100755 (executable)
@@ -68,10 +68,10 @@ _alloc_inodes()
        dir=$1
 
        i=0
-       while [ true ]; do
-               echo -n > $dir/$i >> $seqres.full 2>&1 || break
+       while [ true ]; do
+               echo -n > $dir/$i || break
                i=$((i + 1))
-       done
+       done ) >> $seqres.full 2>&1
 }
 
 # Find a sparse inode cluster after logend_agno/logend_agino.
index f9cd2ff128137acbcf1d77f9d17f0ad8aaede23f..af6af601ab2e6bbfc1ac7b089e25ec421b6ba1cc 100755 (executable)
@@ -34,7 +34,9 @@ _scratch_mount
 STRESS_DIR="$SCRATCH_MNT/testdir"
 mkdir -p $STRESS_DIR
 
-_run_fsstress_bg -d $STRESS_DIR -n 1000 -p 1000 $FSSTRESS_AVOID
+# turn off sync as this can lead to near deadlock conditions due to every
+# fsstress process lockstepping against freeze on large CPU count machines
+_run_fsstress_bg -d $STRESS_DIR -f sync=0 -n 1000 -p 1000 $FSSTRESS_AVOID
 
 # Freeze/unfreeze file system randomly
 echo "Start freeze/unfreeze randomly" | tee -a $seqres.full
index 1da4cbf9218fa52e1b018bbc9bdc34d351a46a3b..678c51b52948c57a615c7551e31ada3468b650b1 100755 (executable)
@@ -33,7 +33,7 @@ _require_xfs_sysfs debug/log_recovery_delay
 _require_scratch
 _require_test_program "t_open_tmpfiles"
 
-_scratch_mkfs >> $seqres.full 2>&1
+_scratch_mkfs "-l size=256m" >> $seqres.full 2>&1
 _scratch_mount
 
 # Set ULIMIT_NOFILE to min(file-max / 2, 30000 files per LOAD_FACTOR)
index 52b8e95a2f09d234dec7ccdd5c9cfae0bdfafde3..10b0017f6b2eb22c5642c9ac308f672c91da3bdf 100755 (executable)
@@ -23,7 +23,7 @@ _require_xfs_io_error_injection "iunlink_fallback"
 _require_scratch
 _require_test_program "t_open_tmpfiles"
 
-_scratch_mkfs | _filter_mkfs 2> $tmp.mkfs > /dev/null
+_scratch_mkfs "-l size=256m" | _filter_mkfs 2> $tmp.mkfs > /dev/null
 cat $tmp.mkfs >> $seqres.full
 . $tmp.mkfs