X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=eta.c;h=350815ee6a9e7d244f9131954b8358eb36fbd91f;hp=31028dd840976e4d1137824c1101269351ec7b2a;hb=d78ee463665c7eb710e5ee5070b7873bee6dc611;hpb=317b95d07d4921d2594a1be6e014c9c2d062fe75 diff --git a/eta.c b/eta.c index 31028dd8..350815ee 100644 --- a/eta.c +++ b/eta.c @@ -107,7 +107,7 @@ static int thread_eta(struct thread_data *td, unsigned long elapsed) * 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 (td->o.verify) { + if (td->o.do_verify && td->o.verify) { if (td_rw(td)) bytes_total = bytes_total * 3 / 2; else @@ -118,13 +118,19 @@ static int thread_eta(struct thread_data *td, unsigned long elapsed) bytes_total /= (td->o.zone_skip / td->o.zone_size); if (td->runstate == TD_RUNNING || td->runstate == TD_VERIFYING) { - double perc; + double perc, perc_t; bytes_done = td->io_bytes[DDIR_READ] + td->io_bytes[DDIR_WRITE]; perc = (double) bytes_done / (double) bytes_total; if (perc > 1.0) perc = 1.0; + if (td->o.time_based) { + perc_t = (double) elapsed / (double) td->o.timeout; + if (perc_t < perc) + perc = perc_t; + } + eta_sec = (unsigned long) (elapsed * (1.0 / perc)) - elapsed; if (td->o.timeout && eta_sec > (td->o.timeout - elapsed))