From: Chao Yu via Linux-f2fs-devel <linux-f2fs-devel@lists.sourceforge.net>
To: Jaegeuk Kim <jaegeuk@kernel.org>, linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH 2/3] f2fs_io: add dontcache to measure RWF_DONTCACHE speed
Date: Tue, 23 Sep 2025 17:38:45 +0800 [thread overview]
Message-ID: <590ad519-d6a4-4eff-9bca-3d6b96eb89bb@kernel.org> (raw)
In-Reply-To: <20250918045316.714102-2-jaegeuk@kernel.org>
Ditto, need to manual entry.
On 9/18/25 12:53, Jaegeuk Kim via Linux-f2fs-devel wrote:
> It only measures the read performance.
>
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> ---
> tools/f2fs_io/f2fs_io.c | 13 ++++++++++++-
> 1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/tools/f2fs_io/f2fs_io.c b/tools/f2fs_io/f2fs_io.c
> index 2d64eda81706..2ed9cb4184b8 100644
> --- a/tools/f2fs_io/f2fs_io.c
> +++ b/tools/f2fs_io/f2fs_io.c
> @@ -24,6 +24,8 @@
> #include <linux/fs.h>
> #include <signal.h>
> #include <stdarg.h>
> +#include <sys/uio.h>
> +#include <stdarg.h>
> #include <stdbool.h>
> #include <stdio.h>
> #include <stdlib.h>
> @@ -929,6 +931,7 @@ static void do_write_advice(int argc, char **argv, const struct cmd_desc *cmd)
> "Read data in file_path and print nbytes\n" \
> "IO can be\n" \
> " buffered : buffered IO\n" \
> +" dontcache: buffered IO + dontcache\n" \
> " dio : direct IO\n" \
> " mmap : mmap IO\n" \
> " mlock : mmap + mlock\n" \
> @@ -948,6 +951,7 @@ static void do_read(int argc, char **argv, const struct cmd_desc *cmd)
> int flags = 0;
> int do_mmap = 0;
> int do_mlock = 0;
> + int do_dontcache = 0;
> int fd, advice;
>
> if (argc != 8) {
> @@ -972,6 +976,8 @@ static void do_read(int argc, char **argv, const struct cmd_desc *cmd)
> do_mmap = 1;
> else if (!strcmp(argv[4], "mlock"))
> do_mlock = 1;
> + else if (!strcmp(argv[4], "dontcache"))
> + do_dontcache = 1;
> else if (strcmp(argv[4], "buffered"))
> die("Wrong IO type");
>
> @@ -1016,7 +1022,12 @@ static void do_read(int argc, char **argv, const struct cmd_desc *cmd)
> read_cnt = count * buf_size;
> } else {
> for (i = 0; i < count; i++) {
> - ret = pread(fd, buf, buf_size, offset + buf_size * i);
> + if (!do_dontcache) {
> + ret = pread(fd, buf, buf_size, offset + buf_size * i);
> + } else {
> + struct iovec iov = { .iov_base = buf, .iov_len = buf_size };
> + ret = preadv2(fd, &iov, 1, offset + buf_size * i, RWF_DONTCACHE);
> + }
> if (ret != buf_size) {
> printf("pread expected: %"PRIu64", readed: %"PRIu64"\n",
> buf_size, ret);
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
next prev parent reply other threads:[~2025-09-23 9:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-18 4:53 [f2fs-dev] [PATCH 1/3] f2fs_io: add mlock to measure the read speed Jaegeuk Kim via Linux-f2fs-devel
2025-09-18 4:53 ` [f2fs-dev] [PATCH 2/3] f2fs_io: add dontcache to measure RWF_DONTCACHE speed Jaegeuk Kim via Linux-f2fs-devel
2025-09-23 9:38 ` Chao Yu via Linux-f2fs-devel [this message]
2025-09-18 4:53 ` [f2fs-dev] [PATCH 3/3] f2fs_io: let's try to get contigous memory if possible Jaegeuk Kim via Linux-f2fs-devel
2025-09-23 9:36 ` [f2fs-dev] [PATCH 1/3] f2fs_io: add mlock to measure the read speed 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=590ad519-d6a4-4eff-9bca-3d6b96eb89bb@kernel.org \
--to=linux-f2fs-devel@lists.sourceforge.net \
--cc=chao@kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).