eta: improve accuracy for rwmix workloads and verify
authorJens Axboe <axboe@kernel.dk>
Wed, 23 Jan 2013 15:40:11 +0000 (08:40 -0700)
committerJens Axboe <axboe@kernel.dk>
Wed, 23 Jan 2013 15:40:11 +0000 (08:40 -0700)
We assume 50/50 for mixed workloads. That's silly, use the actual
number specified instead.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
eta.c

diff --git a/eta.c b/eta.c
index 1f67301a902124e6b922ca980bc5796928525eb3..fdf55c5ab74d260d7c8aa1be842002c5a75b1d25 100644 (file)
--- a/eta.c
+++ b/eta.c
@@ -140,13 +140,19 @@ static int thread_eta(struct thread_data *td)
        }
 
        /*
        }
 
        /*
-        * if writing, bytes_total will be twice the size. If mixing,
-        * assume a 50/50 split and thus bytes_total will be 50% larger.
+        * if writing and verifying afterwards, bytes_total will be twice the
+        * size. In a mixed workload, verify phase will be the size of the
+        * first stage writes.
         */
        if (td->o.do_verify && td->o.verify && td_write(td)) {
         */
        if (td->o.do_verify && td->o.verify && td_write(td)) {
-               if (td_rw(td))
-                       bytes_total = bytes_total * 3 / 2;
-               else
+               if (td_rw(td)) {
+                       unsigned int perc = 50;
+
+                       if (td->o.rwmix[DDIR_WRITE])
+                               perc = td->o.rwmix[DDIR_WRITE];
+
+                       bytes_total += (bytes_total * perc) / 100;
+               } else
                        bytes_total <<= 1;
        }
 
                        bytes_total <<= 1;
        }