From 79eb6c9a17de959d72ee51c601b2764225101282 Mon Sep 17 00:00:00 2001 From: Damien Le Moal Date: Fri, 10 Dec 2021 10:20:41 +0900 Subject: [PATCH] ioengines: libzbc: disable libzbc block backend driver libzbc includes 3 different internal backend drivers: 1) The block backend: this backend relies on the kernel SMR support and uses regular system calls. 2) The SCSI backend: this is a SG passthrough driver for SAS drives and for SATA drives accessible through an SMR compliant SAT (SCSI-to-ATA translation layer). 3) The ATA backend: this is a SG passthrough driver for SATA drives not handled by the system SAT (either kernel or HBA SAT) libzbc automatically selects the internal backend driver, using the first one that is detected as functional (tested in the same order shown above). When running on an SMR enabled system (SMR compliant HBA and kernel with zoned block device support enabled), any fio job using the libzbc IO engine will thus end up using the regular kernel IO path. This is silly: for this IO path, the libaio or psync IO engines are far better (less overhead and more functionalities). The libzbc IO engine should be restricted to be a passthrough engine only, similarly to the sg engine. Fix the libzbc engine to not allow the use of libzbc block backend driver by removing the ZBC_O_DRV_BLOCK flag when opening the device. Also adjust the test script t/zbd/run-tests-against-nullb to remove the -l option to force the use of the libzbc IO engine as it will not work anymore (since the nullb device is neither a SCSI nor an ATA device). Signed-off-by: Damien Le Moal Link: https://lore.kernel.org/r/20211210012041.310670-1-damien.lemoal@opensource.wdc.com Signed-off-by: Jens Axboe --- engines/libzbc.c | 2 +- t/zbd/run-tests-against-nullb | 14 -------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/engines/libzbc.c b/engines/libzbc.c index abee2043..2bc2c7e0 100644 --- a/engines/libzbc.c +++ b/engines/libzbc.c @@ -85,7 +85,7 @@ static int libzbc_open_dev(struct thread_data *td, struct fio_file *f, return -ENOMEM; ret = zbc_open(f->file_name, - flags | ZBC_O_DRV_BLOCK | ZBC_O_DRV_SCSI | ZBC_O_DRV_ATA, + flags | ZBC_O_DRV_SCSI | ZBC_O_DRV_ATA, &ld->zdev); if (ret) { log_err("%s: zbc_open() failed, err=%d\n", diff --git a/t/zbd/run-tests-against-nullb b/t/zbd/run-tests-against-nullb index db901179..7d2c7fa8 100755 --- a/t/zbd/run-tests-against-nullb +++ b/t/zbd/run-tests-against-nullb @@ -19,7 +19,6 @@ usage() echo -e "\t-L List the device layouts for every section without running" echo -e "\t tests." echo -e "\t-s <#section> Only run the section with the given number." - echo -e "\t-l Use libzbc ioengine to run the tests." echo -e "\t-t <#test> Only run the test with the given number in every section." echo -e "\t-o Specify MaxOpen value, (${set_max_open} by default)." echo -e "\t-n <#number of runs> Set the number of times to run the entire suite " @@ -239,7 +238,6 @@ dev_size=1024 dev_blocksize=4096 set_max_open=8 zbd_test_opts=() -libzbc=0 num_of_runs=1 test_case=0 quit_on_err=0 @@ -250,7 +248,6 @@ while (($#)); do -o) set_max_open="${2}"; shift; shift;; -L) list_only=1; shift;; -r) cleanup_nullb; exit 0;; - -l) libzbc=1; shift;; -n) num_of_runs="${2}"; shift; shift;; -t) test_case="${2}"; shift; shift;; -q) quit_on_err=1; shift;; @@ -311,17 +308,6 @@ while ((run_nr <= $num_of_runs)); do exit 1 fi show_nullb_config - if ((libzbc)); then - if ((zone_capacity < zone_size)); then - echo "libzbc doesn't support zone capacity, skipping section $(printf "%02d" $section_number)" - continue - fi - if ((conv_pcnt == 100)); then - echo "libzbc only supports zoned devices, skipping section $(printf "%02d" $section_number)" - continue - fi - zbd_test_opts+=("-l") - fi cd "${scriptdir}" ((intr)) && exit 1 ((list_only)) && continue -- 2.25.1