All of lore.kernel.org
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH 1/3] f2fs_io: measure the start time explicitly
@ 2025-12-01 20:46 Jaegeuk Kim via Linux-f2fs-devel
  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
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Jaegeuk Kim via Linux-f2fs-devel @ 2025-12-01 20:46 UTC (permalink / raw)
  To: linux-f2fs-devel; +Cc: Jaegeuk Kim

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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-12-01 21:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-01 20:46 [f2fs-dev] [PATCH 1/3] f2fs_io: measure the start time explicitly Jaegeuk Kim via Linux-f2fs-devel
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

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.