All of lore.kernel.org
 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>,
	Niklas Cassel <niklas.cassel@wdc.com>,
	Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Subject: [PATCH 1/2] zbd: avoid write with rwmixwrite=0 option
Date: Wed, 20 Dec 2023 09:58:45 +0900	[thread overview]
Message-ID: <20231220005846.1371456-2-shinichiro.kawasaki@wdc.com> (raw)
In-Reply-To: <20231220005846.1371456-1-shinichiro.kawasaki@wdc.com>

Since the commit fb0259fb276a ("zbd: Ensure first I/O is write for
random read/write to sequential zones"), fio issues write as the first
I/O when zonemode=zbd and rw=randrw options are specified. However, fio
issues the first write even when rwmixwrite=0 option is specified. Users
do not expect such write and it confuses the users. To avoid the
confusion, suppress the write by referring td->o.rwmix[DDIR_WRITE].

Fixes: fb0259fb276a ("zbd: Ensure first I/O is write for random read/write to sequential zones")
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
---
 zbd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/zbd.c b/zbd.c
index c4f7b12f..61b5b688 100644
--- a/zbd.c
+++ b/zbd.c
@@ -1876,7 +1876,8 @@ enum fio_ddir zbd_adjust_ddir(struct thread_data *td, struct io_u *io_u,
 	if (ddir != DDIR_READ || !td_rw(td))
 		return ddir;
 
-	if (io_u->file->last_start[DDIR_WRITE] != -1ULL || td->o.read_beyond_wp)
+	if (io_u->file->last_start[DDIR_WRITE] != -1ULL ||
+	    td->o.read_beyond_wp || td->o.rwmix[DDIR_WRITE] == 0)
 		return DDIR_READ;
 
 	return DDIR_WRITE;
-- 
2.43.0


  reply	other threads:[~2023-12-20  0:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-20  0:58 [PATCH 0/2] zbd: fix unexpected write with rwmixwrite=0 option Shin'ichiro Kawasaki
2023-12-20  0:58 ` Shin'ichiro Kawasaki [this message]
2023-12-20  1:30   ` [PATCH 1/2] zbd: avoid " Damien Le Moal
2023-12-20  0:58 ` [PATCH 2/2] t/zbd: add test case to confirm no " Shin'ichiro Kawasaki
2023-12-20  1:31   ` Damien Le Moal
2023-12-20  2:52 ` [PATCH 0/2] zbd: fix unexpected " Jens Axboe

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=20231220005846.1371456-2-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=niklas.cassel@wdc.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.