io_size vs. time_based discrepancy
[fio.git] / backend.c
index b329fa31f62dc929a5bb7c5796b27a2dd03d1cd2..224736f4c963dcef68db671b39b83ec9ed763758 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -448,7 +448,7 @@ static int wait_for_completions(struct thread_data *td, struct timeval *time)
         * if the queue is full, we MUST reap at least 1 event
         */
        min_evts = min(td->o.iodepth_batch_complete_min, td->cur_depth);
-    if ((full && !min_evts) || !td->o.iodepth_batch_complete_min)
+       if ((full && !min_evts) || !td->o.iodepth_batch_complete_min)
                min_evts = 1;
 
        if (time && (__should_check_rate(td, DDIR_READ) ||
@@ -782,7 +782,7 @@ static long long usec_for_io(struct thread_data *td, enum fio_ddir ddir)
        bytes = td->rate_io_issue_bytes[ddir];
        bps = td->rate_bps[ddir];
 
-       if (td->o.poisson_rate) {
+       if (td->o.rate_process == RATE_PROCESS_POISSON) {
                uint64_t val;
                iops = bps / td->o.bs[ddir];
                val = (int64_t) (1000000 / iops) *
@@ -868,7 +868,7 @@ static uint64_t do_io(struct thread_data *td)
                if (flow_threshold_exceeded(td))
                        continue;
 
-               if (bytes_issued >= total_bytes)
+               if (!td->o.time_based && bytes_issued >= total_bytes)
                        break;
 
                io_u = get_io_u(td);