All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jaegeuk Kim via Linux-f2fs-devel <linux-f2fs-devel@lists.sourceforge.net>
To: linux-f2fs-devel@lists.sourceforge.net
Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Subject: [f2fs-dev] [PATCH 1/3] f2fs_io: measure the start time explicitly
Date: Mon,  1 Dec 2025 20:46:18 +0000	[thread overview]
Message-ID: <20251201204620.905318-1-jaegeuk@kernel.org> (raw)

Let's measure the start time more precisely.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 tools/f2fs_io/f2fs_io.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/f2fs_io/f2fs_io.c b/tools/f2fs_io/f2fs_io.c
index 326b3bd033af..bc2e014d3911 100644
--- a/tools/f2fs_io/f2fs_io.c
+++ b/tools/f2fs_io/f2fs_io.c
@@ -1009,8 +1009,8 @@ static void do_read(int argc, char **argv, const struct cmd_desc *cmd)
 		printf("fadvise SEQUENTIAL|WILLNEED to a file: %s\n", argv[7]);
 	}
 
-	io_time_start = get_current_us();
 	if (do_mmap) {
+		io_time_start = get_current_us();
 		data = mmap(NULL, count * buf_size, PROT_READ,
 				MAP_SHARED | MAP_POPULATE, fd, offset);
 		if (data == MAP_FAILED)
@@ -1028,6 +1028,8 @@ static void do_read(int argc, char **argv, const struct cmd_desc *cmd)
 				MAP_SHARED, fd, offset);
 		if (data == MAP_FAILED)
 			die("Mmap failed");
+
+		io_time_start = get_current_us();
 		if (posix_fadvise(fd, offset, count * buf_size,
 					POSIX_FADV_WILLNEED) != 0)
 			die_errno("fadvise failed");
@@ -1040,6 +1042,7 @@ static void do_read(int argc, char **argv, const struct cmd_desc *cmd)
 		read_cnt = count * buf_size;
 		memcpy(print_buf, data, print_bytes);
 	} else {
+		io_time_start = get_current_us();
 		for (i = 0; i < count; i++) {
 			if (!do_dontcache) {
 				ret = pread(fd, buf, buf_size, offset + buf_size * i);
-- 
2.52.0.107.ga0afd4fd5b-goog



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

             reply	other threads:[~2025-12-01 20:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-01 20:46 Jaegeuk Kim via Linux-f2fs-devel [this message]
2025-12-01 20:46 ` [f2fs-dev] [PATCH 2/3] f2fs_io: add read test with mlock2 and madvise Jaegeuk Kim via Linux-f2fs-devel
2025-12-01 21:29   ` Chao Yu via Linux-f2fs-devel
2025-12-01 20:46 ` [f2fs-dev] [PATCH 3/3] f2fs_io: rename mlock to fadvise Jaegeuk Kim via Linux-f2fs-devel
2025-12-01 21:30   ` Chao Yu via Linux-f2fs-devel
2025-12-01 21:25 ` [f2fs-dev] [PATCH 1/3] f2fs_io: measure the start time explicitly Chao Yu via Linux-f2fs-devel

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=20251201204620.905318-1-jaegeuk@kernel.org \
    --to=linux-f2fs-devel@lists.sourceforge.net \
    --cc=jaegeuk@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.