X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=backend.c;h=fb2a8551e396227fc01ed5849e95fbd0e15c38a8;hp=b43486dc7b2ff016b6d76d281dc479692e90b231;hb=14a74557d9f7737a7b2427aef151475d5ce3937c;hpb=78475ac3b9453eff01c34778d70a2aed4aecffe8 diff --git a/backend.c b/backend.c index b43486dc..fb2a8551 100644 --- a/backend.c +++ b/backend.c @@ -1675,7 +1675,7 @@ static void *thread_main(void *data) if (rate_submit_init(td, sk_out)) goto err; - fio_gettime(&td->epoch, NULL); + set_epoch_time(td, o->log_unix_epoch); fio_getrusage(&td->ru_start); memcpy(&td->bw_sample_time, &td->epoch, sizeof(td->epoch)); memcpy(&td->iops_sample_time, &td->epoch, sizeof(td->epoch)); @@ -1731,9 +1731,13 @@ static void *thread_main(void *data) * the rusage_sem, which would never get upped because * this thread is waiting for the stat mutex. */ - check_update_rusage(td); + do { + check_update_rusage(td); + if (!fio_mutex_down_trylock(stat_mutex)) + break; + usleep(1000); + } while (1); - fio_mutex_down(stat_mutex); if (td_read(td) && td->io_bytes[DDIR_READ]) update_runtime(td, elapsed_us, DDIR_READ); if (td_write(td) && td->io_bytes[DDIR_WRITE])