Skip to content

Commit

Permalink
iolog.c: fix inaccurate clat when replay trace
Browse files Browse the repository at this point in the history
When do timestamp replay with high qd it will only reap the
completed commands when the qd reach the max iodepth, the commands
probably are finished long ago before command completion handling.

Fix is to use io_u_queued_complete instead of just usec_sleep in
iolog_delay

Signed-off-by: Kookoo Gu <Zhimin.Gu@solidigm.com>
  • Loading branch information
Kookoo Gu authored and Kookoo Gu committed Jul 27, 2023
1 parent 0b47b2c commit b85c01f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions iolog.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ static void iolog_delay(struct thread_data *td, unsigned long delay)
{
uint64_t usec = utime_since_now(&td->last_issue);
unsigned long orig_delay = delay;
uint64_t this_delay;
struct timespec ts;
int ret = 0;

if (delay < td->time_offset) {
td->time_offset = 0;
Expand All @@ -97,13 +97,13 @@ static void iolog_delay(struct thread_data *td, unsigned long delay)
delay -= usec;

fio_gettime(&ts, NULL);
while (delay && !td->terminate) {
this_delay = delay;
if (this_delay > 500000)
this_delay = 500000;

usec_sleep(td, this_delay);
delay -= this_delay;
while (delay && !td->terminate) {
ret = io_u_queued_complete(td, 0);
if (ret < 0)
td_verror(td, -ret, "io_u_queued_complete");
if (utime_since_now(&ts) > delay)
break;
}

usec = utime_since_now(&ts);
Expand Down

0 comments on commit b85c01f

Please sign in to comment.