From 071c9d2924ce43786c13d8d19d639e2e4bed4fba Mon Sep 17 00:00:00 2001 From: Shin'ichiro Kawasaki Date: Fri, 30 Oct 2020 15:57:39 +0900 Subject: [PATCH] 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 Reviewed-by: Dmitry Fomichev Signed-off-by: Jens Axboe --- zbd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/zbd.c b/zbd.c index 905c0c2b..9327816a 100644 --- a/zbd.c +++ b/zbd.c @@ -718,6 +718,9 @@ static int zbd_reset_zone(struct thread_data *td, struct fio_file *f, uint64_t length = (z+1)->start - offset; int ret = 0; + if (z->wp == z->start) + return 0; + assert(is_valid_offset(f, offset + length - 1)); dprint(FD_ZBD, "%s: resetting wp of zone %u.\n", f->file_name, -- 2.25.1