zbd: allow an unlimited global max open zones limit
authorNiklas Cassel <niklas.cassel@wdc.com>
Thu, 24 Jun 2021 17:23:07 +0000 (17:23 +0000)
committerJens Axboe <axboe@kernel.dk>
Tue, 29 Jun 2021 13:43:29 +0000 (07:43 -0600)
commitb346af906f76533bc0db63b73c0da9bbff34e6d1
tree95f3f067df7f61d0966cf0e57d8498979dba2dff
parentaf94a8c30f42f0b983d6c43213794947ba894668
zbd: allow an unlimited global max open zones limit

Commit 219c662d3b12 ("zbd: introduce per job maximum open zones limit")
Introduced a global max open zones limit stored in zbd_info->max_open_zones.

This commit also removed the following check from zbd_open_zone():

if (!td->o.max_open_zones)
        return true;

Before the commit in question, if td->o.max_open_zones == 0, zbd_open_zone()
would not track the zone as open in the zbd_info->open_zones array.

After the commit in question, zbd_open_zone() would always track the zone
as open in the zbd_info->open_zones array, regardless if a --max_open_zones
limit was set or not.

Change the initialization of zbd_info->max_open_zones to yet again allow
unlimited max open zones. If zbd_info->max_open_zones is unlimited,
we do not track the open zones in the zbd_info->open zone array.

Not tracking open zones reduces fio overhead for testing the performance of
zoned block devices that do not have a limit on the maximum number of open
zones.

Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
zbd.c
zbd.h