* [PATCH v2 1/2] zbd: do not check open zones status and limits when jobs do not write
2025-01-22 1:38 [PATCH v2 0/2] zbd: fix open zone status check for non-write jobs Shin'ichiro Kawasaki
@ 2025-01-22 1:38 ` Shin'ichiro Kawasaki
2025-01-22 8:45 ` Niklas Cassel
2025-01-22 1:38 ` [PATCH v2 2/2] t/zbd: add test case to confirm no max_open_zones limit check Shin'ichiro Kawasaki
` (3 subsequent siblings)
4 siblings, 1 reply; 7+ messages in thread
From: Shin'ichiro Kawasaki @ 2025-01-22 1:38 UTC (permalink / raw)
To: fio, Jens Axboe, Vincent Fu
Cc: Damien Le Moal, Niklas Cassel, Shin'ichiro Kawasaki
Currently, fio checks the conditions of each zone within the IO range at
the job start. If a zone is in an open condition, it is added to the
write target zone array. If the number of write target zones exceeds the
max_open_zones or job_max_open_zones limit, fio terminates with the
error message "Number of open zones exceeds max_open_zones limit". This
check for zone condition and the resulting termination occur even when
the job does not perform a write operation, leading to confusion among
users.
To avoid the confusion, skip the check when jobs do not perform write
operations. Additionally, print the message to inform that the
job_max_open_zones limit does not work for non-write jobs.
Fixes: 954217b90191 ("zbd: Initialize open zones list referring zone status at fio start")
Fixes: 8ac768899d63 ("zbd: do not reset extra zones in open conditions")
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
---
zbd.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/zbd.c b/zbd.c
index 8a092cbe..ee095b1d 100644
--- a/zbd.c
+++ b/zbd.c
@@ -1264,6 +1264,16 @@ int zbd_setup_files(struct thread_data *td)
return 1;
}
+ /*
+ * If this job does not do write operations, skip open zone
+ * condition check.
+ */
+ if (!td_write(td)) {
+ if (td->o.job_max_open_zones)
+ log_info("'job_max_open_zones' is valid only for write jobs\n");
+ continue;
+ }
+
/*
* The per job max open zones limit cannot be used without a
* global max open zones limit. (As the tracking of open zones
--
2.47.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH v2 1/2] zbd: do not check open zones status and limits when jobs do not write
2025-01-22 1:38 ` [PATCH v2 1/2] zbd: do not check open zones status and limits when jobs do not write Shin'ichiro Kawasaki
@ 2025-01-22 8:45 ` Niklas Cassel
0 siblings, 0 replies; 7+ messages in thread
From: Niklas Cassel @ 2025-01-22 8:45 UTC (permalink / raw)
To: Shinichiro Kawasaki
Cc: fio@vger.kernel.org, Jens Axboe, Vincent Fu, Damien Le Moal
On Wed, Jan 22, 2025 at 10:38:34AM +0900, Shin'ichiro Kawasaki wrote:
> Currently, fio checks the conditions of each zone within the IO range at
> the job start. If a zone is in an open condition, it is added to the
> write target zone array. If the number of write target zones exceeds the
> max_open_zones or job_max_open_zones limit, fio terminates with the
> error message "Number of open zones exceeds max_open_zones limit". This
> check for zone condition and the resulting termination occur even when
> the job does not perform a write operation, leading to confusion among
> users.
>
> To avoid the confusion, skip the check when jobs do not perform write
> operations. Additionally, print the message to inform that the
> job_max_open_zones limit does not work for non-write jobs.
>
> Fixes: 954217b90191 ("zbd: Initialize open zones list referring zone status at fio start")
> Fixes: 8ac768899d63 ("zbd: do not reset extra zones in open conditions")
> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
> ---
> zbd.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/zbd.c b/zbd.c
> index 8a092cbe..ee095b1d 100644
> --- a/zbd.c
> +++ b/zbd.c
> @@ -1264,6 +1264,16 @@ int zbd_setup_files(struct thread_data *td)
> return 1;
> }
>
> + /*
> + * If this job does not do write operations, skip open zone
> + * condition check.
> + */
> + if (!td_write(td)) {
> + if (td->o.job_max_open_zones)
> + log_info("'job_max_open_zones' is valid only for write jobs\n");
> + continue;
> + }
> +
> /*
> * The per job max open zones limit cannot be used without a
> * global max open zones limit. (As the tracking of open zones
> --
> 2.47.0
>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 2/2] t/zbd: add test case to confirm no max_open_zones limit check
2025-01-22 1:38 [PATCH v2 0/2] zbd: fix open zone status check for non-write jobs Shin'ichiro Kawasaki
2025-01-22 1:38 ` [PATCH v2 1/2] zbd: do not check open zones status and limits when jobs do not write Shin'ichiro Kawasaki
@ 2025-01-22 1:38 ` Shin'ichiro Kawasaki
2025-01-22 2:59 ` [PATCH v2 0/2] zbd: fix open zone status check for non-write jobs fiotestbot
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Shin'ichiro Kawasaki @ 2025-01-22 1:38 UTC (permalink / raw)
To: fio, Jens Axboe, Vincent Fu
Cc: Damien Le Moal, Niklas Cassel, Shin'ichiro Kawasaki
The previous commit fixed the max_open_zones limit check for non-write
jobs. Add a test case to confirm the fix.
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
---
t/zbd/test-zbd-support | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/t/zbd/test-zbd-support b/t/zbd/test-zbd-support
index e0b2a755..468fce70 100755
--- a/t/zbd/test-zbd-support
+++ b/t/zbd/test-zbd-support
@@ -1608,6 +1608,35 @@ test69() {
>> "${logfile}.${test_number}" 2>&1 || return $?
}
+# Test max_open_zones and job_max_open_zones do not error out for non-write jobs
+test70() {
+ require_zbd || return "$SKIP_TESTCASE"
+
+ reset_zone "${dev}" -1
+
+ # Write data to two zones and make them open
+ run_fio_on_seq "$(ioengine "psync")" --io_size="$min_seq_write_size" \
+ --rw=write --offset_increment=1z --numjobs=2 \
+ --group_reporting=1 >> "${logfile}.${test_number}" 2>&1
+
+ # Confirm max_open_zones=1 for read workload does not fail
+ run_fio_on_seq "$(ioengine "psync")" --io_size="$min_seq_write_size" \
+ --rw=read --max_open_zones=1 \
+ >> "${logfile}.${test_number}" 2>&1 || return $?
+
+ # Confirm job_max_open_zones=1 for read workload does not fail
+ run_fio_on_seq "$(ioengine "psync")" --io_size="$min_seq_write_size" \
+ --rw=read --job_max_open_zones=1 \
+ >> "${logfile}.${test_number}" 2>&1
+ grep -q 'valid only for write jobs' \
+ "${logfile}.${test_number}" || return $?
+
+ # Confirm max_open_zones=1 for trim workload does not fail
+ run_fio_on_seq "$(ioengine "psync")" --rw=trim --io_size=1z \
+ --bs="$zone_size" --max_open_zones=1 \
+ >> "${logfile}.${test_number}" 2>&1
+}
+
SECONDS=0
tests=()
dynamic_analyzer=()
--
2.47.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH v2 0/2] zbd: fix open zone status check for non-write jobs
2025-01-22 1:38 [PATCH v2 0/2] zbd: fix open zone status check for non-write jobs Shin'ichiro Kawasaki
2025-01-22 1:38 ` [PATCH v2 1/2] zbd: do not check open zones status and limits when jobs do not write Shin'ichiro Kawasaki
2025-01-22 1:38 ` [PATCH v2 2/2] t/zbd: add test case to confirm no max_open_zones limit check Shin'ichiro Kawasaki
@ 2025-01-22 2:59 ` fiotestbot
2025-01-22 5:59 ` Damien Le Moal
2025-01-22 16:16 ` Vincent Fu
4 siblings, 0 replies; 7+ messages in thread
From: fiotestbot @ 2025-01-22 2:59 UTC (permalink / raw)
To: fio
[-- Attachment #1: Type: text/plain, Size: 144 bytes --]
The result of fio's continuous integration tests was: success
For more details see https://github.com/fiotestbot/fio/actions/runs/12899960142
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 0/2] zbd: fix open zone status check for non-write jobs
2025-01-22 1:38 [PATCH v2 0/2] zbd: fix open zone status check for non-write jobs Shin'ichiro Kawasaki
` (2 preceding siblings ...)
2025-01-22 2:59 ` [PATCH v2 0/2] zbd: fix open zone status check for non-write jobs fiotestbot
@ 2025-01-22 5:59 ` Damien Le Moal
2025-01-22 16:16 ` Vincent Fu
4 siblings, 0 replies; 7+ messages in thread
From: Damien Le Moal @ 2025-01-22 5:59 UTC (permalink / raw)
To: Shin'ichiro Kawasaki, fio, Jens Axboe, Vincent Fu; +Cc: Niklas Cassel
On 1/22/25 10:38 AM, Shin'ichiro Kawasaki wrote:
> Currently, fio checks if each zone within the IO range is in an open
> condition or not. This check is done even if the job does not perform
> any write operations, and causes confusion among users.
>
> This series addresses the problem. The first patch fixes it, and the
> second patch adds a test case to confirm the fix.
Looks good to me. For the series:
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
--
Damien Le Moal
Western Digital Research
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH v2 0/2] zbd: fix open zone status check for non-write jobs
2025-01-22 1:38 [PATCH v2 0/2] zbd: fix open zone status check for non-write jobs Shin'ichiro Kawasaki
` (3 preceding siblings ...)
2025-01-22 5:59 ` Damien Le Moal
@ 2025-01-22 16:16 ` Vincent Fu
4 siblings, 0 replies; 7+ messages in thread
From: Vincent Fu @ 2025-01-22 16:16 UTC (permalink / raw)
To: Shin'ichiro Kawasaki, fio, Jens Axboe; +Cc: Damien Le Moal, Niklas Cassel
On 1/21/25 8:38 PM, Shin'ichiro Kawasaki wrote:
> Currently, fio checks if each zone within the IO range is in an open
> condition or not. This check is done even if the job does not perform
> any write operations, and causes confusion among users.
>
> This series addresses the problem. The first patch fixes it, and the
> second patch adds a test case to confirm the fix.
>
> Changes from v1:
> * 1st patch: added Fixes tags
>
> Shin'ichiro Kawasaki (2):
> zbd: do not check open zones status and limits when jobs do not write
> t/zbd: add test case to confirm no max_open_zones limit check
>
> t/zbd/test-zbd-support | 29 +++++++++++++++++++++++++++++
> zbd.c | 10 ++++++++++
> 2 files changed, 39 insertions(+)
>
Applied. Thanks.
Vincent
^ permalink raw reply [flat|nested] 7+ messages in thread