Fix bug with rwmix and multiple loops over the same set
authorJens Axboe <jens.axboe@oracle.com>
Wed, 3 Jun 2009 08:30:33 +0000 (10:30 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Wed, 3 Jun 2009 08:30:33 +0000 (10:30 +0200)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
fio.c
fio.h
io_u.c

diff --git a/fio.c b/fio.c
index bdf9fd1..6ac8ef0 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -880,7 +880,6 @@ static void reset_io_counters(struct thread_data *td)
        td->zone_bytes = 0;
        td->rate_bytes = 0;
        td->rate_blocks = 0;
-       td->rw_end_set[0] = td->rw_end_set[1] = 0;
 
        td->last_was_sync = 0;
 
@@ -1065,21 +1064,11 @@ static void *thread_main(void *data)
                clear_state = 1;
 
                if (td_read(td) && td->io_bytes[DDIR_READ]) {
-                       if (td->rw_end_set[DDIR_READ])
-                               elapsed = utime_since(&td->start,
-                                                     &td->rw_end[DDIR_READ]);
-                       else
-                               elapsed = utime_since_now(&td->start);
-
+                       elapsed = utime_since_now(&td->start);
                        runtime[DDIR_READ] += elapsed;
                }
                if (td_write(td) && td->io_bytes[DDIR_WRITE]) {
-                       if (td->rw_end_set[DDIR_WRITE])
-                               elapsed = utime_since(&td->start,
-                                                     &td->rw_end[DDIR_WRITE]);
-                       else
-                               elapsed = utime_since_now(&td->start);
-
+                       elapsed = utime_since_now(&td->start);
                        runtime[DDIR_WRITE] += elapsed;
                }
 
diff --git a/fio.h b/fio.h
index b2e40d2..0a72819 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -332,12 +332,10 @@ struct thread_data {
 
        struct timeval start;   /* start of this loop */
        struct timeval epoch;   /* time job was started */
-       struct timeval rw_end[2];
        struct timeval last_issue;
        struct timeval tv_cache;
        unsigned int tv_cache_nr;
        unsigned int tv_cache_mask;
-       unsigned int rw_end_set[2];
        unsigned int ramp_time_over;
 
        /*
diff --git a/io_u.c b/io_u.c
index 5cf2526..40fd196 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -319,7 +319,6 @@ static enum fio_ddir get_rw_ddir(struct thread_data *td)
                 * Check if it's time to seed a new data direction.
                 */
                if (td->io_issues[td->rwmix_ddir] >= td->rwmix_issues) {
-                       unsigned long long max_bytes;
                        enum fio_ddir ddir;
 
                        /*
@@ -328,16 +327,6 @@ static enum fio_ddir get_rw_ddir(struct thread_data *td)
                         * ranges too much
                         */
                        ddir = get_rand_ddir(td);
-                       max_bytes = td->this_io_bytes[ddir];
-                       if (max_bytes >=
-                           (td->o.size * td->o.rwmix[ddir] / 100)) {
-                               if (!td->rw_end_set[ddir]) {
-                                       td->rw_end_set[ddir] = 1;
-                                       fio_gettime(&td->rw_end[ddir], NULL);
-                               }
-
-                               ddir ^= 1;
-                       }
 
                        if (ddir != td->rwmix_ddir)
                                set_rwmix_bytes(td);