zbd: write to closed zones on the devices with max_active_zones limit
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Wed, 19 Jul 2023 10:57:45 +0000 (19:57 +0900)
committerVincent Fu <vincent.fu@samsung.com>
Thu, 20 Jul 2023 13:52:37 +0000 (09:52 -0400)
Current fio implementation does not handle zones in closed condition as
write target zones. When the device has max_active_zones limit, the
write to other zones may cause errors by exceeding the limit, since the
zones in closed condition consume the device resource for the
max_active_zones limit.

To avoid the error, handle the zones in closed condition as write target
in same manner as the zones in open condition when the device has the
max_active_zones limit. At the job start, check each condition of the
zones in the IO ranges and if it has closed condition, pass the zone
to zbd_write_zones_get() in same manner as the zones in open condition.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Link: https://lore.kernel.org/r/20230719105756.553146-3-shinichiro.kawasaki@wdc.com
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
zbd.c

diff --git a/zbd.c b/zbd.c
index a5cb34d228eed3b40db189f5f4d8bf862a81c317..b05d2360d927062842c2a380ce19ed760e2f385d 100644 (file)
--- a/zbd.c
+++ b/zbd.c
@@ -1276,7 +1276,11 @@ int zbd_setup_files(struct thread_data *td)
                for (zi = f->min_zone; zi < f->max_zone; zi++) {
                        z = &zbd->zone_info[zi];
                        if (z->cond != ZBD_ZONE_COND_IMP_OPEN &&
-                           z->cond != ZBD_ZONE_COND_EXP_OPEN)
+                           z->cond != ZBD_ZONE_COND_EXP_OPEN &&
+                           z->cond != ZBD_ZONE_COND_CLOSED)
+                               continue;
+                       if (!zbd->max_active_zones &&
+                           z->cond == ZBD_ZONE_COND_CLOSED)
                                continue;
                        if (__zbd_write_zone_get(td, f, z))
                                continue;