From: Jens Axboe Date: Thu, 7 Feb 2013 18:55:24 +0000 (+0100) Subject: Fix bug with rate and read/write mixed workloads at 100% bias X-Git-Tag: fio-2.0.14~21 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=e0224c6bd115b0decd4f330fa8ff43f5e0cc6811;p=fio.git Fix bug with rate and read/write mixed workloads at 100% bias The rate_ddir() might sometimes decide to send the other data direction, even if we have a workload with rw=randrw and rwmixread=0. Check for this condition. Signed-off-by: Jens Axboe --- diff --git a/io_u.c b/io_u.c index 6ae3eae8..65988819 100644 --- a/io_u.c +++ b/io_u.c @@ -490,7 +490,7 @@ static enum fio_ddir rate_ddir(struct thread_data *td, enum fio_ddir ddir) assert(ddir_rw(ddir)); - if (td->rate_pending_usleep[ddir] <= 0) + if (td->rate_pending_usleep[ddir] <= 0 || !td->o.rwmix[odir]) return ddir; /* @@ -545,6 +545,7 @@ static enum fio_ddir rate_ddir(struct thread_data *td, enum fio_ddir ddir) if (ddir_trim(ddir)) return ddir; + return ddir; }