From: Vincent Fu <vincentfu@gmail.com>
To: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>,
fio@vger.kernel.org, Jens Axboe <axboe@kernel.dk>
Cc: Damien Le Moal <dlemoal@kernel.org>,
Dmitry Fomichev <Dmitry.Fomichev@wdc.com>,
Niklas Cassel <niklas.cassel@wdc.com>
Subject: Re: [PATCH] t/zbd: avoid test case 45 failure
Date: Fri, 13 Oct 2023 17:32:46 -0400 [thread overview]
Message-ID: <e3d6913b-b1ef-7281-2dc5-adfd370034bf@gmail.com> (raw)
In-Reply-To: <20231006071320.425270-1-shinichiro.kawasaki@wdc.com>
On 10/6/23 03:13, Shin'ichiro Kawasaki wrote:
> When zonemode=zbd option is not specified, random writes to zoned block
> devices fail because writes to sequential write required zones shall
> happen only at write pointers. Randomly chosen write addresses do not
> match with the write pointers, then fail. On such failures, fio prints
> out the message below and tell users how to avoid the failures:
>
> "fio: first I/O failed. If .* is a zoned block device, consider --zonemode=zbd".
>
> The test case 45 in t/zbd/test-zbd-support confirms the message is
> printed when the first random write command to a sequential write
> required zone fails. However, the random write can succeed very rarely
> since the randomly chosen write address can be same as the write pointer
> address. For example, a zoned block device with 1MB zone size with 4KB
> block size device can have the first random write at write pointer with
> ratio of 4KB/1MB = 1/256. This causes sporadic test case failures.
>
> Avoid the failures by two changes. Firstly, change the random write
> range from a zone to whole sequential write required zones to reduce the
> failure ratio. Secondly, repeat the test if the message is not printed
> by the accidental write success. As the test repeated, failure ratio is
> multiplied and the failure ratio becomes as small as it can be ignored.
>
> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
> ---
> t/zbd/test-zbd-support | 15 ++++++++++-----
> 1 file changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/t/zbd/test-zbd-support b/t/zbd/test-zbd-support
> index 0436d319..2f15a191 100755
> --- a/t/zbd/test-zbd-support
> +++ b/t/zbd/test-zbd-support
> @@ -1058,15 +1058,20 @@ test44() {
>
> test45() {
> local bs i
> + local grep_str="fio: first I/O failed. If .* is a zoned block device, consider --zonemode=zbd"
>
> require_zbd || return $SKIP_TESTCASE
> prep_write
> bs=$((min_seq_write_size))
> - run_one_fio_job "$(ioengine "psync")" --iodepth=1 --rw=randwrite --bs=$bs\
> - --offset=$((first_sequential_zone_sector * 512)) \
> - --size="$zone_size" --do_verify=1 --verify=md5 2>&1 |
> - tee -a "${logfile}.${test_number}" |
> - grep -q "fio: first I/O failed. If .* is a zoned block device, consider --zonemode=zbd"
> + for ((i = 0; i < 10; i++)); do
> + run_one_fio_job "$(ioengine "psync")" --iodepth=1 --rw=randwrite \
> + --offset=$((first_sequential_zone_sector * 512)) \
> + --bs="$bs" --time_based --runtime=1s \
> + --do_verify=1 --verify=md5 \
> + >> "${logfile}.${test_number}" 2>&1
> + grep -qe "$grep_str" "${logfile}.${test_number}" && return 0
> + done
> + return 1
> }
>
> # Random write to sequential zones, libaio, 8 jobs, queue depth 64 per job
Applied. Thanks.
Vincent
prev parent reply other threads:[~2023-10-13 21:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-06 7:13 [PATCH] t/zbd: avoid test case 45 failure Shin'ichiro Kawasaki
2023-10-13 21:32 ` Vincent Fu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e3d6913b-b1ef-7281-2dc5-adfd370034bf@gmail.com \
--to=vincentfu@gmail.com \
--cc=Dmitry.Fomichev@wdc.com \
--cc=axboe@kernel.dk \
--cc=dlemoal@kernel.org \
--cc=fio@vger.kernel.org \
--cc=niklas.cassel@wdc.com \
--cc=shinichiro.kawasaki@wdc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).