From 819a4a96b6ee8ba5ec631b63ae10b82d28c7d0d0 Mon Sep 17 00:00:00 2001 From: Sitsofe Wheeler Date: Sun, 27 Nov 2016 17:13:27 +0000 Subject: [PATCH] eta: Fix ramp time ETA Ramp time ETA in thread_eta() was was assuming all rate directions were being used and that bytes_total was in kilobytes. Signed-off-by: Sitsofe Wheeler --- eta.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/eta.c b/eta.c index c2c9d4e8..fe7b1e00 100644 --- a/eta.c +++ b/eta.c @@ -259,9 +259,16 @@ static unsigned long thread_eta(struct thread_data *td) t_eta -= ramp_left; } } - rate_bytes = ddir_rw_sum(td->o.rate); + rate_bytes = 0; + if (td_read(td)) + rate_bytes = td->o.rate[DDIR_READ]; + if (td_write(td)) + rate_bytes += td->o.rate[DDIR_WRITE]; + if (td_trim(td)) + rate_bytes += td->o.rate[DDIR_TRIM]; + if (rate_bytes) { - r_eta = (bytes_total / 1024) / rate_bytes; + r_eta = bytes_total / rate_bytes; r_eta += (td->o.start_delay / 1000000ULL); } -- 2.25.1