]> www.infradead.org Git - users/sagi/blktests.git/commitdiff
block/004: Adjust fio conditions for zoned block devices
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Mon, 28 Jan 2019 13:14:46 +0000 (22:14 +0900)
committerOmar Sandoval <osandov@fb.com>
Tue, 5 Feb 2019 18:41:35 +0000 (10:41 -0800)
For a random write pattern to a zoned block device, fio requires --direct=1
and --zonemode=zbd options as well as deadline I/O scheduler to be
specified. Specify these options and set the I/O scheduler if the target
device is a zoned block device. Before doing that, also make sure that the
deadline scheduler is available and that fio supports the zbd zone mode.
Set CAN_BE_ZONED flag to run this test case for zoned block devices.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
tests/block/004

index 4c14c4b36b3d8a1592b466962731dbe5eb4f2a18..d181725e6f80d4f58b1e9bfae4601fd0fca8a5d9 100755 (executable)
@@ -8,18 +8,32 @@
 
 DESCRIPTION="run lots of flushes"
 TIMED=1
+CAN_BE_ZONED=1
 
 requires() {
        _have_fio
 }
 
+device_requires() {
+       ! _test_dev_is_zoned || _have_fio_zbd_zonemode
+}
+
 test_device() {
        echo "Running ${TEST_NAME}"
 
+       local directio=""
+       local zbdmode=""
+
+       if _test_dev_is_zoned; then
+               _test_dev_queue_set scheduler deadline
+               directio="--direct=1"
+               zbdmode="--zonemode=zbd"
+       fi
+
        FIO_PERF_FIELDS=("write iops")
        _fio_perf --bs=4k --rw=randwrite --norandommap --fsync=1 \
                --number_ios=256 --numjobs=64 --name=flushes \
-               --filename="$TEST_DEV"
+               ${directio} ${zbdmode} --filename="$TEST_DEV"
 
        echo "Test complete"
 }