rate = (td->this_io_bytes[ddir] - td->rate_bytes) / spent;
if (rate < td->ratemin) {
- fprintf(f_out, "%s: min rate %d not met, got %ldKiB/sec\n", td->name, td->ratemin, rate);
+ fprintf(f_out, "%s: min rate %u not met, got %luKiB/sec\n", td->name, td->ratemin, rate);
return 1;
}
}
* The main verify engine. Runs over the writes we previusly submitted,
* reads the blocks back in, and checks the crc/md5 of the data.
*/
-void do_verify(struct thread_data *td)
+static void do_verify(struct thread_data *td)
{
struct io_u *io_u, *v_io_u = NULL;
struct io_completion_data icd;
if (runtime_exceeded(td, &icd.time))
break;
- if (td->thinktime)
- usec_sleep(td, td->thinktime);
+ if (td->thinktime) {
+ unsigned long long b;
+
+ b = td->io_blocks[0] + td->io_blocks[1];
+ if (!(td->thinktime_blocks % b))
+ usec_sleep(td, td->thinktime);
+ }
}
if (!td->error) {
max_units = td->iodepth;
max_bs = max(td->max_bs[DDIR_READ], td->max_bs[DDIR_WRITE]);
- td->orig_buffer_size = max_bs * max_units + MASK;
+ td->orig_buffer_size = max_bs * max_units;
+
+ if (td->mem_type == MEM_SHMHUGE || td->mem_type == MEM_MMAPHUGE)
+ td->orig_buffer_size = (td->orig_buffer_size + td->hugepage_size - 1) & ~(td->hugepage_size - 1);
+ else
+ td->orig_buffer_size += MASK;
if (allocate_io_mem(td))
return 1;