X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=io_u.c;h=7709df5fe55bf7fb6237d6b93476b2f09a2d3d3d;hp=6a53bdaab074fcf9660c6e25e08c19408bd0dca2;hb=78c1eda5486f586ca73e9cbe7e40b93fccdbd218;hpb=5f739e0e2912b809635fac635a8c1140155577e6 diff --git a/io_u.c b/io_u.c index 6a53bdaa..7709df5f 100644 --- a/io_u.c +++ b/io_u.c @@ -486,6 +486,16 @@ static enum fio_ddir rate_ddir(struct thread_data *td, enum fio_ddir ddir) } else usec = td->rate_pending_usleep[ddir]; + /* + * We are going to sleep, ensure that we flush anything pending as + * not to skew our latency numbers + */ + if (td->cur_depth) { + int fio_unused ret; + + ret = io_u_queued_complete(td, td->cur_depth, NULL); + } + fio_gettime(&t, NULL); usec_sleep(td, usec); usec = utime_since_now(&t);