Commit
ac28d9053679 changed it so we don't clear ->bytes_done[]
necessarily for each loop. However, this introduced a busy loop
where we this we did IO and continue to loop, but we really
didn't.
Fixes:
ac28d9053679 ("Fixup bw/iops logging for short runs")
Signed-off-by: Jens Axboe <axboe@fb.com>
unsigned int i;
int ret = 0;
uint64_t total_bytes, bytes_issued = 0;
+ uint64_t this_bytes[2];
+
+ this_bytes[0] = td->bytes_done[DDIR_WRITE];
+ this_bytes[1] = td->bytes_done[DDIR_TRIM];
if (in_ramp_time(td))
td_set_runstate(td, TD_RAMP);
if (!ddir_rw_sum(td->this_io_bytes))
td->done = 1;
- return td->bytes_done[DDIR_WRITE] + td->bytes_done[DDIR_TRIM];
+ return (td->bytes_done[DDIR_WRITE] - this_bytes[0]) +
+ (td->bytes_done[DDIR_TRIM] - this_bytes[1]);
}
static void cleanup_io_u(struct thread_data *td)