zbd: Avoid excessive zone resets
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Fri, 30 Oct 2020 06:57:39 +0000 (15:57 +0900)
committerJens Axboe <axboe@kernel.dk>
Fri, 30 Oct 2020 13:24:58 +0000 (07:24 -0600)
commit071c9d2924ce43786c13d8d19d639e2e4bed4fba
treed3def4613a7d1f37971b46f0d32bfabcd1828a3a
parenta0b72421064b5dd7312812509e9babe923063deb
zbd: Avoid excessive zone resets

When zbd_reset_zone() is called for a zone repeatedly, reset zone command
is issued multiple times to a single zone even though its status is
empty. This is excessive and meaningless. Especially when zones are reset
at file set up with multiple jobs, zone reset is repeated for each job
and delays fio work load start.

To avoid the repeated zone resets, check the write pointer of the zone
before issuing zone reset command. If the write pointer is at the zone
start, do not reset the zone and just return.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Reviewed-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
zbd.c