Skip to content

Commit 3fee125

Browse files
Ming Leiaxboe
authored andcommitted
selftests: ublk: make IO & device removal test more stressful
__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 <[email protected]> Cc: Shinichiro Kawasaki <[email protected]> Signed-off-by: Ming Lei <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 39eb810 commit 3fee125

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

tools/testing/selftests/ublk/test_common.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ __run_io_and_remove()
251251
local kill_server=$3
252252

253253
fio --name=job1 --filename=/dev/ublkb"${dev_id}" --ioengine=libaio \
254-
--rw=readwrite --iodepth=256 --size="${size}" --numjobs=4 \
254+
--rw=randrw --norandommap --iodepth=256 --size="${size}" --numjobs="$(nproc)" \
255255
--runtime=20 --time_based > /dev/null 2>&1 &
256256
sleep 2
257257
if [ "${kill_server}" = "yes" ]; then

tools/testing/selftests/ublk/test_stress_02.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@ _create_backfile 0 256M
2525
_create_backfile 1 128M
2626
_create_backfile 2 128M
2727

28-
ublk_io_and_kill_daemon 8G -t null -q 4 &
29-
ublk_io_and_kill_daemon 256M -t loop -q 4 "${UBLK_BACKFILES[0]}" &
30-
ublk_io_and_kill_daemon 256M -t stripe -q 4 "${UBLK_BACKFILES[1]}" "${UBLK_BACKFILES[2]}" &
31-
wait
28+
for nr_queue in 1 4; do
29+
ublk_io_and_kill_daemon 8G -t null -q "$nr_queue" &
30+
ublk_io_and_kill_daemon 256M -t loop -q "$nr_queue" "${UBLK_BACKFILES[0]}" &
31+
ublk_io_and_kill_daemon 256M -t stripe -q "$nr_queue" "${UBLK_BACKFILES[1]}" "${UBLK_BACKFILES[2]}" &
32+
wait
33+
done
3234

3335
_cleanup_test "stress"
3436
_show_result $TID $ERR_CODE

0 commit comments

Comments
 (0)