Make 'loops' honor full write+verify loops
authorJens Axboe <axboe@fb.com>
Tue, 24 Feb 2015 22:50:57 +0000 (14:50 -0800)
committerJens Axboe <axboe@fb.com>
Tue, 24 Feb 2015 22:50:57 +0000 (14:50 -0800)
Signed-off-by: Jens Axboe <axboe@fb.com>
backend.c
fio.h
init.c

index 3430e6612d4312740f31045d6ebf6ff4ff96950b..fdb7413d7719ff9ff4b46af8e611c072c6918435 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -658,10 +658,10 @@ static unsigned int exceeds_number_ios(struct thread_data *td)
        if (!td->o.number_ios)
                return 0;
 
-       number_ios = ddir_rw_sum(td->this_io_blocks);
+       number_ios = ddir_rw_sum(td->io_blocks);
        number_ios += td->io_u_queued + td->io_u_in_flight;
 
-       return number_ios >= td->o.number_ios;
+       return number_ios >= (td->o.number_ios * td->loops);
 }
 
 static int io_issue_bytes_exceeded(struct thread_data *td)
@@ -682,6 +682,7 @@ static int io_issue_bytes_exceeded(struct thread_data *td)
        else
                limit = td->o.size;
 
+       limit *= td->loops;
        return bytes >= limit || exceeds_number_ios(td);
 }
 
@@ -703,6 +704,7 @@ static int io_complete_bytes_exceeded(struct thread_data *td)
        else
                limit = td->o.size;
 
+       limit *= td->loops;
        return bytes >= limit || exceeds_number_ios(td);
 }
 
diff --git a/fio.h b/fio.h
index d28f8ce59cf15cee75c86d13f95099894dd2b547..f6880841b048353ed027698ba67003b3f0998454 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -240,6 +240,7 @@ struct thread_data {
         */
        uint64_t io_issues[DDIR_RWDIR_CNT];
        uint64_t io_issue_bytes[DDIR_RWDIR_CNT];
+       uint64_t loops;
 
        /*
         * Completions
diff --git a/init.c b/init.c
index c210ad257ce3125a1ecb62152fe26648a5d320bc..7aedf2bf5aaa7c5edc606dfa42c7b1f82d4865ea 100644 (file)
--- a/init.c
+++ b/init.c
@@ -763,6 +763,10 @@ static int fixup_options(struct thread_data *td)
                fio_gtod_offload = 1;
        }
 
+       td->loops = o->loops;
+       if (!td->loops)
+               td->loops = 1;
+
        return ret;
 }