All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vincent Fu <vincent.fu@samsung.com>
To: "axboe@kernel.dk" <axboe@kernel.dk>,
	"fio@vger.kernel.org" <fio@vger.kernel.org>
Cc: Vincent Fu <vincent.fu@samsung.com>
Subject: [PATCH 4/5] ioengines: update last_issue if we set issue_time
Date: Tue, 14 Jun 2022 15:58:29 +0000	[thread overview]
Message-ID: <20220614155822.307771-5-vincent.fu@samsung.com> (raw)
In-Reply-To: <20220614155822.307771-1-vincent.fu@samsung.com>

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>
---
 engines/io_uring.c |  6 ++++++
 engines/libaio.c   |  6 ++++++
 ioengines.c        | 30 ++++++++++++++++--------------
 3 files changed, 28 insertions(+), 14 deletions(-)

diff --git a/engines/io_uring.c b/engines/io_uring.c
index 474d215c..cffc7371 100644
--- a/engines/io_uring.c
+++ b/engines/io_uring.c
@@ -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)
diff --git a/engines/libaio.c b/engines/libaio.c
index da5279f4..33b8c12f 100644
--- a/engines/libaio.c
+++ b/engines/libaio.c
@@ -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)
diff --git a/ioengines.c b/ioengines.c
index e4ad698c..e2316ee4 100644
--- a/ioengines.c
+++ b/ioengines.c
@@ -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;
-- 
2.25.1

  parent reply	other threads:[~2022-06-14 15:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20220614155830uscas1p1e1d6595b29fb6960b405d5b295a32ffc@uscas1p1.samsung.com>
2022-06-14 15:58 ` [PATCH 0/5] Latency cleanups Vincent Fu
     [not found]   ` <CGME20220614155830uscas1p15aaa5d3bc8eec3da42c78a48520c6dd9@uscas1p1.samsung.com>
2022-06-14 15:58     ` [PATCH 2/5] ioengines: don't record issue_time if ioengines already do it Vincent Fu
2022-06-15 15:26       ` Nick Neumann
2022-06-15 17:06         ` Vincent Fu
2022-06-15 17:51           ` Nick Neumann
     [not found]   ` <CGME20220614155831uscas1p2312cb623924e5df60abefb210affa1f4@uscas1p2.samsung.com>
2022-06-14 15:58     ` [PATCH 3/5] HOWTO: improve description of latency measures Vincent Fu
     [not found]   ` <CGME20220614155831uscas1p12c7b262538a47a417dc783a45e8df049@uscas1p1.samsung.com>
2022-06-14 15:58     ` Vincent Fu [this message]
     [not found]   ` <CGME20220614155830uscas1p2586c5e612430bdd2ce455a1081ce08e4@uscas1p2.samsung.com>
2022-06-14 15:58     ` [PATCH 1/5] ioengines: add helper for trims with async ioengines Vincent Fu
     [not found]   ` <CGME20220614155831uscas1p16ab7450c13a1587f2058617130f4f122@uscas1p1.samsung.com>
2022-06-14 15:58     ` [PATCH 5/5] ioengines: clean up latency accounting for 3 ioengines Vincent Fu
2022-06-15 21:30   ` [PATCH 0/5] Latency cleanups Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220614155822.307771-5-vincent.fu@samsung.com \
    --to=vincent.fu@samsung.com \
    --cc=axboe@kernel.dk \
    --cc=fio@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.