io_u: skip to the next zone when zoneskip is set to zero
authorVincent Fu <vincent.fu@wdc.com>
Tue, 15 Oct 2019 14:29:56 +0000 (10:29 -0400)
committerJens Axboe <axboe@kernel.dk>
Tue, 15 Oct 2019 15:14:49 +0000 (09:14 -0600)
If zoneskip is not set or set to 0 in zonemode=strided mode, all IO
occurs in a single zone. If zoneskip is non-zero, the next zone begins
zoneskip bytes beyond the end of the current zone. Thus, it's not
possible to access contiguous zones since zoneskip bytes will separate
the end of one zone and the beginning of the next zone.

This patch allows fio to move to the next zone when zoneskip is
explicitly set to 0, making it possible to issue IO to contiguous zones.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_u.c

diff --git a/io_u.c b/io_u.c
index 94899552c5b2daa1deeb956c18aa31e2c8a5068d..5cbbe85a4180f3d5f8cac1c7d4047fed7961d459 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -850,7 +850,8 @@ static void setup_strided_zone_mode(struct thread_data *td, struct io_u *io_u)
        /*
         * See if it's time to switch to a new zone
         */
-       if (td->zone_bytes >= td->o.zone_size && td->o.zone_skip) {
+       if (td->zone_bytes >= td->o.zone_size &&
+                       fio_option_is_set(&td->o, zone_skip)) {
                td->zone_bytes = 0;
                f->file_offset += td->o.zone_range + td->o.zone_skip;