From: Jens Axboe Date: Wed, 3 Jun 2009 08:30:33 +0000 (+0200) Subject: Fix bug with rwmix and multiple loops over the same set X-Git-Tag: fio-1.27~3 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=0a4957c60fb35db0973c15c4c2adbd3bac854ccd Fix bug with rwmix and multiple loops over the same set Signed-off-by: Jens Axboe --- diff --git a/fio.c b/fio.c index bdf9fd18..6ac8ef05 100644 --- 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 b2e40d22..0a728192 100644 --- 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 5cf2526b..40fd1968 100644 --- 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);