t/zbd: Add test #58 to test zone reset by trim workload
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Fri, 6 Aug 2021 01:07:11 +0000 (10:07 +0900)
committerJens Axboe <axboe@kernel.dk>
Fri, 6 Aug 2021 22:39:31 +0000 (16:39 -0600)
To exercise zone reset by trim workload, add the test case #58. As the
precondition, it fills several zones. After that, a trim job and a write
job run in parallel for 30 seconds. The ratio of trim commands and write
commands is controlled by --flow option.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Tested-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Reviewed-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
t/zbd/test-zbd-support

index 57e6d05ea73744858d56ee86341963460c7c0cf6..5103c4060faad3f300edfec598ff98ef1eada94f 100755 (executable)
@@ -1215,6 +1215,32 @@ test57() {
                >> "${logfile}.${test_number}" 2>&1 || return $?
 }
 
+# Random writes and random trims to sequential write required zones for 30s.
+test58() {
+    local off size bs
+
+    require_seq_zones 128 || return $SKIP_TESTCASE
+
+    size=$((zone_size * 128))
+    bs="$(max $((zone_size / 128)) "$logical_block_size")"
+    prep_write
+    off=$((first_sequential_zone_sector * 512))
+    run_fio --zonemode=zbd --direct=1 --zonesize="${zone_size}" --thread=1 \
+           --filename="${dev}" --norandommap=1 \
+            --name="precondition"  --rw=write "$(ioengine "psync")" \
+            --offset="${off}" --size=$((zone_size * 16)) --bs="${bs}" \
+           "${job_var_opts[@]}" \
+           --name=wjob --wait_for="precondition" --rw=randwrite \
+           "$(ioengine "libaio")" --iodepth=8 \
+           --offset="${off}" --size="${size}" --bs="${bs}" \
+           --time_based --runtime=30s --flow=128 "${job_var_opts[@]}" \
+           --name=trimjob --wait_for="precondition" --rw=randtrim \
+           "$(ioengine "psync")" \
+           --offset="${off}" --size="${size}" --bs="${zone_size}" \
+           --time_based --runtime=30s --flow=1 "${job_var_opts[@]}" \
+           >>"${logfile}.${test_number}" 2>&1
+}
+
 SECONDS=0
 tests=()
 dynamic_analyzer=()