t/zbd: set mq-deadline scheduler to device-mapper destination devices
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Wed, 13 Sep 2023 01:52:49 +0000 (10:52 +0900)
committerVincent Fu <vincent.fu@samsung.com>
Tue, 26 Sep 2023 13:00:13 +0000 (09:00 -0400)
commit996ac91f54844e63ef43092472fc1f7610567b67
tree3f48313af8a82faa9351e8f3c926aaf991b2ff67
parenta142e0df6c1483a76d92ff7f9d8c07242af9910e
t/zbd: set mq-deadline scheduler to device-mapper destination devices

When write workloads run on zoned block devices, mq-deadline scheduler is
required to ensure write operations are sequential. To fulfill this
requirement, the test script t/zbd/test-zbd-support sets mq-deadline to
the sysfs attribute "queue/scheduler". However, this preparation does
not work when the write target device is a bio based device-mapper
device. The device is bio based then I/O scheduler does not work.
Setting mq-deadline to the sysfs attribute has no effect. On top of
that, the sysfs attribute "queue/scheduler" is no longer available for
bio based device-mapper devices since Linux kernel version v6.5.

To ensure mq-deadline scheduler for bio based device-mapper devices,
improve the helper function set_io_scheduler. If the sysfs attribute
"queue/scheduler" is available, use it. Otherwise, check if the test
device is a zoned device-mapper (linear, flakey or crypt). If so, set
mq-deadline scheduler to destination devices of the device-mapper
device. To implement these, add some helper functions.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Link: https://lore.kernel.org/r/20230913015249.2226799-1-shinichiro.kawasaki@wdc.com
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
t/zbd/functions
t/zbd/test-zbd-support