ioengines: clean up latency accounting for 3 ioengines
authorVincent Fu <vincent.fu@samsung.com>
Tue, 14 Jun 2022 15:58:29 +0000 (15:58 +0000)
committerJens Axboe <axboe@kernel.dk>
Wed, 15 Jun 2022 21:30:05 +0000 (15:30 -0600)
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 <vincent.fu@samsung.com>
Link: https://lore.kernel.org/r/20220614155822.307771-6-vincent.fu@samsung.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
engines/librpma_apm.c
engines/librpma_fio.c
engines/librpma_gpspm.c
engines/rdma.c

index d1166ad839f3f1bf326557d7a5d140e01ea56905..896240dd2a139b5ca7d022e0fd93e4e492da20d3 100644 (file)
@@ -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),
 };
index 34818904d0c3d6a3542e553fe3a104512313379f..a78a1e57676bb3665a06f09485130ed9f2637a47 100644 (file)
@@ -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];
index 5cf974722de2052c97d8485faea2b5d924638ddd..f00717a731c43298f270bb6aa7f0908221c9b161 100644 (file)
@@ -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),
 };
index 4eb86652f40e87e60a1ab2d6dd2373a2d7ca8fba..e3bb2567e0627b80cbe7183d5714bad23af7230e 100644 (file)
@@ -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)
@@ -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),
 };