Allow random overwrite workloads to write io_limit
authorJustin Eno <jeno@micron.com>
Thu, 29 Jan 2015 20:27:58 +0000 (12:27 -0800)
committerJens Axboe <axboe@fb.com>
Mon, 16 Feb 2015 22:00:46 +0000 (15:00 -0700)
Limiting the write phase of (random) overwrite workloads to 'size'
before the verify phase doesn't make sense, so allow them to write
up to io_limit.  This better matches verify_only behavior, and
allows the [verify-job] below to succeed:

[global]
thread=1
direct=1
ioengine=sync
verify=meta
bs=1k
offset=0
size=5M
io_limit=6M
norandommap=1
verify_fatal=1
randseed=42

[write-job]
filename=datafile.tmp
rw=randwrite
do_verify=0

[verify-job]
stonewall
create_serialize=0
filename=datafile.tmp
rw=randwrite
do_verify=1
verify_only=1

Signed-off-by: Justin Eno <jeno@micron.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
backend.c

index 0f6e4259c4cd5eee6f490bb50e344b95db9c976b..3430e6612d4312740f31045d6ebf6ff4ff96950b 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -726,12 +726,18 @@ static uint64_t do_io(struct thread_data *td)
 
        lat_target_init(td);
 
 
        lat_target_init(td);
 
+       total_bytes = td->o.size;
+       /*
+       * Allow random overwrite workloads to write up to io_limit
+       * before starting verification phase as 'size' doesn't apply.
+       */
+       if (td_write(td) && td_random(td) && td->o.norandommap)
+               total_bytes = max(total_bytes, (uint64_t) td->o.io_limit);
        /*
         * If verify_backlog is enabled, we'll run the verify in this
         * handler as well. For that case, we may need up to twice the
         * amount of bytes.
         */
        /*
         * If verify_backlog is enabled, we'll run the verify in this
         * handler as well. For that case, we may need up to twice the
         * amount of bytes.
         */
-       total_bytes = td->o.size;
        if (td->o.verify != VERIFY_NONE &&
           (td_write(td) && td->o.verify_backlog))
                total_bytes += td->o.size;
        if (td->o.verify != VERIFY_NONE &&
           (td_write(td) && td->o.verify_backlog))
                total_bytes += td->o.size;