From 3bd2078bdd1c173f9d02bc20e2d630302555a8a0 Mon Sep 17 00:00:00 2001 From: Naohiro Aota Date: Fri, 28 Feb 2020 16:12:48 +0900 Subject: [PATCH] zbd: add test for stressing zone locking Add a test to stress zone locking mechanism by having a large number of threads with a small number of max_open_zones. Run 30 seconds time-based fio under the timeout command. After 45 seconds, "timeout" kill -KILL the fio process. If a zone lock deadlocks, fio is killed by the timeout command, and this test fails. If not, fio runs to the end and this test success. Reviewed-by: Damien Le Moal Tested-by: Damien Le Moal Signed-off-by: Naohiro Aota Signed-off-by: Jens Axboe --- t/zbd/test-zbd-support | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/t/zbd/test-zbd-support b/t/zbd/test-zbd-support index 5d079a8b..bd41fffb 100755 --- a/t/zbd/test-zbd-support +++ b/t/zbd/test-zbd-support @@ -755,6 +755,36 @@ test47() { grep -q 'zoneskip 1 is not a multiple of the device zone size' "${logfile}.${test_number}" } +# Multiple overlapping random write jobs for the same drive and with a +# limited number of open zones. This is similar to test29, but uses libaio +# to stress test zone locking. +test48() { + local i jobs=16 off opts=() + + off=$((first_sequential_zone_sector * 512 + 64 * zone_size)) + size=$((16*zone_size)) + [ -n "$is_zbd" ] && reset_zone "$dev" $((off / 512)) + opts=("--aux-path=/tmp" "--allow_file_create=0" "--significant_figures=10") + opts+=("--debug=zbd") + opts+=("--ioengine=libaio" "--rw=randwrite" "--direct=1") + opts+=("--time_based" "--runtime=30") + opts+=("--zonemode=zbd" "--zonesize=${zone_size}") + opts+=("--max_open_zones=4") + for ((i=0;i>"${logfile}.${test_number}" + + timeout -v -s KILL 45s \ + "${dynamic_analyzer[@]}" "$fio" "${opts[@]}" \ + >> "${logfile}.${test_number}" 2>&1 || return $? +} + tests=() dynamic_analyzer=() reset_all_zones= -- 2.25.1