If we have rate_ignore_thinktime set, we account the number of bytes
we would have done in the period of the sleep. However, we need
to subtract one block, otherwise we end up doing a rated sleep
right after the thinktime sleep.
Fixes:
1a9bf814 ("Add option to ignore thinktime for rated IO")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
/*
* If we're ignoring thinktime for the rate, add the number of bytes
- * we would have done while sleeping.
+ * we would have done while sleeping, minus one block to ensure we
+ * start issuing immediately after the sleep.
*/
- if (total && td->rate_bps[ddir] && td->o.rate_ign_think)
+ if (total && td->rate_bps[ddir] && td->o.rate_ign_think) {
td->rate_io_issue_bytes[ddir] += (td->rate_bps[ddir] * 1000000) / total;
+ td->rate_io_issue_bytes[ddir] -= td->o.min_bs[ddir];
+ }
}
/*