zbd: introduce per job maximum open zones limit
authorAlexey Dobriyan <adobriyan@gmail.com>
Thu, 21 May 2020 23:17:15 +0000 (02:17 +0300)
committerJens Axboe <axboe@kernel.dk>
Thu, 21 May 2020 23:23:12 +0000 (17:23 -0600)
commit219c662d3b125ebd7db8976286d178ccbe1c81a2
tree86c5bda256970162b98d6a9548e0aaa2f4bf02e2
parentfae3b9a0af400f4e4c576d35bf97ef655be5fc78
zbd: introduce per job maximum open zones limit

It is not possible to maintain sustained per-thread iodepth in ZBD mode.
The way code is written, "max_open_zones" acts as a global limit, and
once one or few threads open all "max_open_zones" zones, other threads
can't open anything and _exit_ prematurely.

This config is guaranteed to make equal number of zone resets/IO now:
each thread generates identical pattern and doesn't intersect with other
threads:

zonemode=zbd
zonesize=...
rw=write

numjobs=N
offset_increment=M*zonesize

[j]
size=M*zonesize

Patch introduces "job_max_open_zones" which is per-thread/process limit.
"max_open_zones" remains per file/device limit. Both limits are checked
for each open zone so one thread can't kick out others.

Signed-off-by: Alexey Dobriyan (SK hynix) <adobriyan@gmail.com>
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fio.1
fio.h
options.c
thread_options.h
zbd.c
zbd.h