fio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
To: fio@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
	Vincent Fu <vincentfu@gmail.com>
Cc: Damien Le Moal <dlemoal@kernel.org>,
	Dmitry Fomichev <Dmitry.Fomichev@wdc.com>,
	Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Subject: [PATCH 3/3] t/zbd: avoid test case 31 failure with small devices
Date: Tue, 30 Apr 2024 19:30:22 +0900	[thread overview]
Message-ID: <20240430103022.4136039-4-shinichiro.kawasaki@wdc.com> (raw)
In-Reply-To: <20240430103022.4136039-1-shinichiro.kawasaki@wdc.com>

The test case assumed that the test target devices have 128 or more
sequential write required zones and uses 128 as the minimum number of
zones to write. This caused failure when the devices had a smaller
number of sequential write required zones. To avoid the failure, count
the actual number of sequential write required zones and use it if it is
smaller than 128.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
---
 t/zbd/test-zbd-support | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/t/zbd/test-zbd-support b/t/zbd/test-zbd-support
index ef98835c..e0b2a755 100755
--- a/t/zbd/test-zbd-support
+++ b/t/zbd/test-zbd-support
@@ -852,12 +852,15 @@ test31() {
     # To distribute the write target zones evenly, skip certain zones for every
     # write. Utilize zonemode strided for such write patterns.
     bs=$((128 * 1024))
+    off=$((first_sequential_zone_sector * 512))
+    size=$((disk_size - off))
     nz=$((max_open_zones))
     if [[ $nz -eq 0 ]]; then
 	nz=128
     fi
-    off=$((first_sequential_zone_sector * 512))
-    size=$((disk_size - off))
+    if ((size / zone_size < nz)); then
+	nz=$((size / zone_size))
+    fi
     inc=$(((size / nz / zone_size) * zone_size))
     opts=("--name=$dev" "--filename=$dev" "--rw=write" "--bs=${bs}")
     opts+=("--offset=$off" "--size=$((inc * nz))" "--io_size=$((bs * nz))")
-- 
2.44.0


  parent reply	other threads:[~2024-04-30 10:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-30 10:30 [PATCH 0/3] zbd: fix two zonemode zbd problems Shin'ichiro Kawasaki
2024-04-30 10:30 ` [PATCH 1/3] zbd: remove unnecessary verify_backlog check in zbd_file_reset() Shin'ichiro Kawasaki
2024-04-30 10:30 ` [PATCH 2/3] t/zbd: add test case to confirm verify_backlog=1 options Shin'ichiro Kawasaki
2024-04-30 10:30 ` Shin'ichiro Kawasaki [this message]
2024-04-30 17:35 ` [PATCH 0/3] zbd: fix two zonemode zbd problems Vincent Fu

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=20240430103022.4136039-4-shinichiro.kawasaki@wdc.com \
    --to=shinichiro.kawasaki@wdc.com \
    --cc=Dmitry.Fomichev@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=dlemoal@kernel.org \
    --cc=fio@vger.kernel.org \
    --cc=vincentfu@gmail.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).