From: vincentfu@gmail.com
To: axboe@kernel.dk, fio@vger.kernel.org
Cc: Vincent Fu <vincent.fu@wdc.com>
Subject: [PATCH 2/3] filesetup: use zonerange for map and LFSR with zonemode=strided
Date: Tue, 15 Oct 2019 10:29:57 -0400 [thread overview]
Message-ID: <20191015142958.14559-3-vincentfu@gmail.com> (raw)
In-Reply-To: <20191015142958.14559-1-vincentfu@gmail.com>
From: Vincent Fu <vincent.fu@wdc.com>
When a random map is enabled, cover only the current zone when run with
zonemode=strided. This ensures that when we reach the end of the zone we
wrap around back into the current zone instead of accessing blocks
outside of the zone.
In addition, when an LFSR is used, constrain the blocks generated to the
current zone. Previously, the LFSR random_generator would ignore the
strided zonemode setting.
Fixes: https://github.com/axboe/fio/issues/809
---
filesetup.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/filesetup.c b/filesetup.c
index a439b6d6..1d3094c1 100644
--- a/filesetup.c
+++ b/filesetup.c
@@ -1338,6 +1338,9 @@ bool init_random_map(struct thread_data *td)
for_each_file(td, f, i) {
uint64_t fsize = min(f->real_file_size, f->io_size);
+ if (td->o.zone_mode == ZONE_MODE_STRIDED)
+ fsize = td->o.zone_range;
+
blocks = fsize / (unsigned long long) td->o.rw_min_bs;
if (check_rand_gen_limits(td, f, blocks))
--
2.17.1
next prev parent reply other threads:[~2019-10-15 14:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-15 14:29 [PATCH 0/3] zonemode=strided fixes vincentfu
2019-10-15 14:29 ` [PATCH 1/3] io_u: skip to the next zone when zoneskip is set to zero vincentfu
2019-10-15 14:29 ` vincentfu [this message]
2019-10-15 14:29 ` [PATCH 3/3] testing: add test script for zonemode=strided vincentfu
2019-10-15 15:15 ` [PATCH 0/3] zonemode=strided fixes 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=20191015142958.14559-3-vincentfu@gmail.com \
--to=vincentfu@gmail.com \
--cc=axboe@kernel.dk \
--cc=fio@vger.kernel.org \
--cc=vincent.fu@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