ioengines: update last_issue if we set issue_time
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)
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 <vincent.fu@samsung.com>
Link: https://lore.kernel.org/r/20220614155822.307771-5-vincent.fu@samsung.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
engines/io_uring.c
engines/libaio.c
ioengines.c

index 474d215c277313ee9e94902a79e5dc613507113d..cffc73710ddd6654399ab051dd929aec02b1e646 100644 (file)
@@ -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)
index da5279f48501919f6b8d0a72054255f2e10a2a2f..33b8c12f96fb191af478114d1a1feb563ffb0440 100644 (file)
@@ -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)
index e4ad698c6775d0c57b4689f99825da396338ec1d..e2316ee4e391d0d5899c960552fec4d19aa33ca2 100644 (file)
@@ -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));
+               }
        }
 
 
@@ -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;