Skip to content

Commit

Permalink
zbd/012: Test higher queue depths
Browse files Browse the repository at this point in the history
Instead of only testing queue depth 1, also test higher queue depths.
Use libaio for higher queue depths since io_uring does not preserve the
write order if qd >= 2 and a request queue is frozen. io_uring is still
required for qd = 1 case to catch the kernel hang regression.

Signed-off-by: Bart Van Assche <[email protected]>
[Shin'ichiro: Removed a tab, and noted qd=1 io_uring necessity]
Signed-off-by: Shin'ichiro Kawasaki <[email protected]>
  • Loading branch information
bvanassche authored and kawasaki committed Jan 8, 2025
1 parent e7c1732 commit 827924b
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 38 deletions.
83 changes: 45 additions & 38 deletions tests/zbd/012
Original file line number Diff line number Diff line change
Expand Up @@ -29,45 +29,52 @@ toggle_iosched() {
test() {
echo "Running ${TEST_NAME}"

# To do: make this test pass for qd > 1.
local qd=1
echo "$qd"
local scsi_debug_params=(
delay=0
dev_size_mb=1024
every_nth=$((2 * qd))
max_queue="${qd}"
opts=0x8000 # SDEBUG_OPT_HOST_BUSY
sector_size=4096
zbc=host-managed
zone_nr_conv=0
zone_size_mb=4
)
_init_scsi_debug "${scsi_debug_params[@]}" &&
local zdev="/dev/${SCSI_DEBUG_DEVICES[0]}" fail &&
ls -ld "${zdev}" >>"${FULL}" &&
{ toggle_iosched & } &&
toggle_iosched_pid=$! &&
local fail &&
local fio_args=(
--direct=1
--filename="${zdev}"
--iodepth="${qd}"
--ioengine=io_uring
--ioscheduler=none
--name="requeuing-and-queue-freezing-${qd}"
--runtime="${TIMEOUT:-30}"
--rw=randwrite
--time_based
--zonemode=zbd
for qd in 1 2 4 8 16; do
echo "$qd"
local scsi_debug_params=(
delay=0
dev_size_mb=1024
every_nth=$((2 * qd))
max_queue="${qd}"
opts=0x8000 # SDEBUG_OPT_HOST_BUSY
sector_size=4096
zbc=host-managed
zone_nr_conv=0
zone_size_mb=4
)
if ! fio "${fio_args[@]}" >>"${FULL}" 2>&1; then
fail=true
fi
if [ -n "${toggle_iosched_pid}" ]; then
kill "${toggle_iosched_pid}" >>"${FULL}" 2>&1
fi
_exit_scsi_debug >>"${FULL}" 2>&1
_init_scsi_debug "${scsi_debug_params[@]}" &&
local zdev="/dev/${SCSI_DEBUG_DEVICES[0]}" fail &&
ls -ld "${zdev}" >>"${FULL}" &&
{ toggle_iosched & } &&
toggle_iosched_pid=$! &&
local fail &&
local ioengine &&
if [ $qd = 1 ]; then
ioengine=io_uring
else
ioengine=libaio
fi
local fio_args=(
--direct=1
--filename="${zdev}"
--iodepth="${qd}"
--ioengine="${ioengine}"
--ioscheduler=none
--name="requeuing-and-queue-freezing-${qd}"
--runtime=$((${TIMEOUT:-30}/5))
--rw=randwrite
--time_based
--zonemode=zbd
)
if ! fio "${fio_args[@]}" >>"${FULL}" 2>&1; then
fail=true
fi
if [ -n "${toggle_iosched_pid}" ]; then
kill "${toggle_iosched_pid}" >>"${FULL}" 2>&1
fi
_exit_scsi_debug >>"${FULL}" 2>&1
[ -z "$fail" ] || break
done

if [ -z "$fail" ]; then
echo "Test complete"
Expand Down
4 changes: 4 additions & 0 deletions tests/zbd/012.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Running zbd/012
1
2
4
8
16
Test complete

0 comments on commit 827924b

Please sign in to comment.