Improve rwmix states
We didn't use to look at the previous bytes done for the
data directions, which skewed the mix for buffered IO.
Fix that up.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/init.c b/init.c
index b4b4abe..911ee32 100644
--- a/init.c
+++ b/init.c
@@ -171,8 +171,8 @@
{
struct thread_options *o = &td->o;
- if (!o->rwmixread && o->rwmixwrite)
- o->rwmixread = 100 - o->rwmixwrite;
+ if (o->rwmix[DDIR_READ] + o->rwmix[DDIR_WRITE] > 100)
+ o->rwmix[DDIR_WRITE] = 100 - o->rwmix[DDIR_READ];
if (o->write_iolog_file && o->read_iolog_file) {
log_err("fio: read iolog overrides write_iolog\n");