eta: fix comparison reversal for time based jobs
authorJens Axboe <axboe@fb.com>
Wed, 9 Dec 2015 16:08:10 +0000 (09:08 -0700)
committerJens Axboe <axboe@fb.com>
Wed, 9 Dec 2015 16:08:10 +0000 (09:08 -0700)
If time_based=1 and runtime=x, then we know the job will take x
time to run. Fix a bug introduced in a previous commit.

Fixes: ("Fix ETA calculations")
Signed-off-by: Jens Axboe <axboe@fb.com>
eta.c

diff --git a/eta.c b/eta.c
index 8785540..4362ffe 100644 (file)
--- a/eta.c
+++ b/eta.c
@@ -214,7 +214,7 @@ static unsigned long thread_eta(struct thread_data *td)
                if (td->o.time_based) {
                        if (timeout) {
                                perc_t = (double) elapsed / (double) timeout;
-                               if (perc_t > perc)
+                               if (perc_t < perc)
                                        perc = perc_t;
                        } else {
                                /*