Skip to content

Commit

Permalink
ioengines: update last_issue if we set issue_time
Browse files Browse the repository at this point in the history
If we're not updating issue_time it doesn't make sense to update
last_issue. We should also be updating last_issue in libaio and io_uring
when we record issue_time.

Signed-off-by: Vincent Fu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
vincentkfu authored and axboe committed Jun 15, 2022
1 parent 13ddd98 commit 39f5640
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 14 deletions.
6 changes: 6 additions & 0 deletions engines/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,12 @@ static void fio_ioring_queued(struct thread_data *td, int start, int nr)

start++;
}

/*
* only used for iolog
*/
if (td->o.read_iolog_file)
memcpy(&td->last_issue, &now, sizeof(now));
}

static int fio_ioring_commit(struct thread_data *td)
Expand Down
6 changes: 6 additions & 0 deletions engines/libaio.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,12 @@ static void fio_libaio_queued(struct thread_data *td, struct io_u **io_us,
memcpy(&io_u->issue_time, &now, sizeof(now));
io_u_queued(td, io_u);
}

/*
* only used for iolog
*/
if (td->o.read_iolog_file)
memcpy(&td->last_issue, &now, sizeof(now));
}

static int fio_libaio_commit(struct thread_data *td)
Expand Down
30 changes: 16 additions & 14 deletions ioengines.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,15 +358,16 @@ enum fio_q_status td_io_queue(struct thread_data *td, struct io_u *io_u)

if (td_ioengine_flagged(td, FIO_SYNCIO) ||
async_ioengine_sync_trim(td, io_u)) {
if (fio_fill_issue_time(td))
if (fio_fill_issue_time(td)) {
fio_gettime(&io_u->issue_time, NULL);

/*
* only used for iolog
*/
if (td->o.read_iolog_file)
memcpy(&td->last_issue, &io_u->issue_time,
sizeof(io_u->issue_time));
/*
* only used for iolog
*/
if (td->o.read_iolog_file)
memcpy(&td->last_issue, &io_u->issue_time,
sizeof(io_u->issue_time));
}
}


Expand Down Expand Up @@ -443,15 +444,16 @@ enum fio_q_status td_io_queue(struct thread_data *td, struct io_u *io_u)
if (!td_ioengine_flagged(td, FIO_SYNCIO) &&
!async_ioengine_sync_trim(td, io_u)) {
if (fio_fill_issue_time(td) &&
!td_ioengine_flagged(td, FIO_ASYNCIO_SETS_ISSUE_TIME))
!td_ioengine_flagged(td, FIO_ASYNCIO_SETS_ISSUE_TIME)) {
fio_gettime(&io_u->issue_time, NULL);

/*
* only used for iolog
*/
if (td->o.read_iolog_file)
memcpy(&td->last_issue, &io_u->issue_time,
sizeof(io_u->issue_time));
/*
* only used for iolog
*/
if (td->o.read_iolog_file)
memcpy(&td->last_issue, &io_u->issue_time,
sizeof(io_u->issue_time));
}
}

return ret;
Expand Down

0 comments on commit 39f5640

Please sign in to comment.