Skip to content

Commit

Permalink
ioengines: clean up latency accounting for 3 ioengines
Browse files Browse the repository at this point in the history
The librpma_apm_client, librpma_gpspm_client, and rdma ioengines have
commit functions that record submission latency. In order to avoid
setting issue_time twice add the FIO_ASYNCIO_SETS_ISSUE_TIME flag. Also
add code to update the iolog issue time when needed.

I don't have the means to test this patch.

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 39f5640 commit 2b82135
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion engines/librpma_apm.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ FIO_STATIC struct ioengine_ops ioengine_client = {
.errdetails = librpma_fio_client_errdetails,
.close_file = librpma_fio_file_nop,
.cleanup = client_cleanup,
.flags = FIO_DISKLESSIO,
.flags = FIO_DISKLESSIO | FIO_ASYNCIO_SETS_ISSUE_TIME,
.options = librpma_fio_options,
.option_struct_size = sizeof(struct librpma_fio_options_values),
};
Expand Down
9 changes: 8 additions & 1 deletion engines/librpma_fio.c
Original file line number Diff line number Diff line change
Expand Up @@ -621,9 +621,16 @@ int librpma_fio_client_commit(struct thread_data *td)
}
}

if ((fill_time = fio_fill_issue_time(td)))
if ((fill_time = fio_fill_issue_time(td))) {
fio_gettime(&now, NULL);

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

}
/* move executed io_us from queued[] to flight[] */
for (i = 0; i < ccd->io_u_queued_nr; i++) {
struct io_u *io_u = ccd->io_us_queued[i];
Expand Down
2 changes: 1 addition & 1 deletion engines/librpma_gpspm.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ FIO_STATIC struct ioengine_ops ioengine_client = {
.errdetails = librpma_fio_client_errdetails,
.close_file = librpma_fio_file_nop,
.cleanup = client_cleanup,
.flags = FIO_DISKLESSIO,
.flags = FIO_DISKLESSIO | FIO_ASYNCIO_SETS_ISSUE_TIME,
.options = librpma_fio_options,
.option_struct_size = sizeof(struct librpma_fio_options_values),
};
Expand Down
9 changes: 8 additions & 1 deletion engines/rdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,12 @@ static void fio_rdmaio_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_rdmaio_commit(struct thread_data *td)
Expand Down Expand Up @@ -1404,7 +1410,8 @@ FIO_STATIC struct ioengine_ops ioengine = {
.cleanup = fio_rdmaio_cleanup,
.open_file = fio_rdmaio_open_file,
.close_file = fio_rdmaio_close_file,
.flags = FIO_DISKLESSIO | FIO_UNIDIR | FIO_PIPEIO,
.flags = FIO_DISKLESSIO | FIO_UNIDIR | FIO_PIPEIO |
FIO_ASYNCIO_SETS_ISSUE_TIME,
.options = options,
.option_struct_size = sizeof(struct rdmaio_options),
};
Expand Down

0 comments on commit 2b82135

Please sign in to comment.