]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
selftests: ublk: make IO & device removal test more stressful
authorMing Lei <ming.lei@redhat.com>
Mon, 19 May 2025 03:16:20 +0000 (11:16 +0800)
committerJens Axboe <axboe@kernel.dk>
Tue, 20 May 2025 16:24:13 +0000 (10:24 -0600)
__run_io_and_remove() is used in several stress tests for running heavy
IO vs. removing device meantime.

However, sequential `readwrite` is taken in the fio script, which isn't
correct, we should take random IO for saturating ublk device.

Also turns out '--num_jobs=4' isn't stressful enough, so change it to
'--num_jobs=$(nproc)'.

Finally we don't cover single queue test in `test_stress_02.sh`, so add
single queue test which can trigger request tag recycling easier.

With above change the issue in #1 can be reproduced reliably in stress_02.sh.

Link:https://lore.kernel.org/linux-block/mruqwpf4tqenkbtgezv5oxwq7ngyq24jzeyqy4ixzvivatbbxv@4oh2wzz4e6qn/ #1

Cc: Jared Holzman <jholzman@nvidia.com>
Cc: Shinichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20250519031620.245749-1-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
tools/testing/selftests/ublk/test_common.sh
tools/testing/selftests/ublk/test_stress_02.sh

index a81210ca3e99d264f84260aab35827e0c00add01..c17fd66b73ac8ae2d78b8c01cd2c6c4fa818f328 100755 (executable)
@@ -251,7 +251,7 @@ __run_io_and_remove()
        local kill_server=$3
 
        fio --name=job1 --filename=/dev/ublkb"${dev_id}" --ioengine=libaio \
-               --rw=readwrite --iodepth=256 --size="${size}" --numjobs=4 \
+               --rw=randrw --norandommap --iodepth=256 --size="${size}" --numjobs="$(nproc)" \
                --runtime=20 --time_based > /dev/null 2>&1 &
        sleep 2
        if [ "${kill_server}" = "yes" ]; then
index 1a9065125ae1b2caa61e882ad4cf17d05ff77732..4bdd921081e5592f8b228afe3254fe2c40880962 100755 (executable)
@@ -25,10 +25,12 @@ _create_backfile 0 256M
 _create_backfile 1 128M
 _create_backfile 2 128M
 
-ublk_io_and_kill_daemon 8G -t null -q 4 &
-ublk_io_and_kill_daemon 256M -t loop -q 4 "${UBLK_BACKFILES[0]}" &
-ublk_io_and_kill_daemon 256M -t stripe -q 4 "${UBLK_BACKFILES[1]}" "${UBLK_BACKFILES[2]}" &
-wait
+for nr_queue in 1 4; do
+       ublk_io_and_kill_daemon 8G -t null -q "$nr_queue" &
+       ublk_io_and_kill_daemon 256M -t loop -q "$nr_queue" "${UBLK_BACKFILES[0]}" &
+       ublk_io_and_kill_daemon 256M -t stripe -q "$nr_queue" "${UBLK_BACKFILES[1]}" "${UBLK_BACKFILES[2]}" &
+       wait
+done
 
 _cleanup_test "stress"
 _show_result $TID $ERR_CODE