X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=fio.c;h=b376c7a17939459173e4ebd6a6c2242b2697e727;hp=e8181a1c317f6a8a7a595100f9beed12126e9e5f;hb=d52fb0c44567cf4fdc2a2c307c32672cc5a57170;hpb=9c1f7434526606fc8a4296190a2dea5de2651266 diff --git a/fio.c b/fio.c index e8181a1c..b376c7a1 100644 --- a/fio.c +++ b/fio.c @@ -379,7 +379,6 @@ static void do_io(struct thread_data *td) td_set_runstate(td, TD_RUNNING); while (td->this_io_bytes[td->ddir] < td->io_size) { - struct timespec ts = { .tv_sec = 0, .tv_nsec = 0}; struct timespec *timeout; int min_evts = 0; struct io_u *io_u; @@ -407,6 +406,8 @@ static void do_io(struct thread_data *td) add_slat_sample(td, io_u->ddir, mtime_since(&io_u->start_time, &io_u->issue_time)); if (td->cur_depth < td->iodepth) { + struct timespec ts = { .tv_sec = 0, .tv_nsec = 0}; + timeout = &ts; min_evts = 0; } else { @@ -451,7 +452,7 @@ static void do_io(struct thread_data *td) unsigned long long b; b = td->io_blocks[0] + td->io_blocks[1]; - if (!(td->thinktime_blocks % b)) + if (!(b % td->thinktime_blocks)) usec_sleep(td, td->thinktime); } } @@ -672,6 +673,7 @@ static void *thread_main(void *data) if (td->exec_prerun) system(td->exec_prerun); + init_disk_util(td); fio_gettime(&td->epoch, NULL); getrusage(RUSAGE_SELF, &td->ru_start); @@ -835,8 +837,6 @@ static void run_threads(void) for_each_td(td, i) { print_status_init(td->thread_number - 1); - init_disk_util(td); - if (!td->create_serialize) continue;