From: Chao Yu <chao@kernel.org>
To: daejun7.park@samsung.com,
"jaegeuk@kernel.org" <jaegeuk@kernel.org>,
"linux-f2fs-devel@lists.sourceforge.net"
<linux-f2fs-devel@lists.sourceforge.net>
Cc: Nayeon Kim <nayeoni.kim@samsung.com>,
Siwoo Jung <siu.jung@samsung.com>,
Seokhwan Kim <sukka.kim@samsung.com>,
Jeuk Kim <jeuk20.kim@samsung.com>,
Dongjin Kim <dongjin_.kim@samsung.com>
Subject: Re: [f2fs-dev] [PATCH] f2fs-tools: add write hint support
Date: Thu, 15 Aug 2024 11:33:16 +0800 [thread overview]
Message-ID: <ce74a0ac-1c64-43db-ae74-eac621982484@kernel.org> (raw)
In-Reply-To: <20240809073246epcms2p134ead07aadfe72e7e3506efc5098ad7f@epcms2p1>
On 2024/8/9 15:32, Daejun Park wrote:
> This patch enables support for write hints by segment type.
What about adding an option to enable this functionality? otherwise,
for a device which doesn't support whint feature, it will cause
overhead whenever calling fcntl() syscall.
[snip]
> @@ -1005,7 +1005,7 @@ int get_device_info(int i)
> #endif
>
> if (!c.sparse_mode) {
> - if (dev->zoned_model == F2FS_ZONED_HM && c.func == FSCK)
> + if (dev->zoned_model == F2FS_ZONED_HM)
Why do we need to change the condtion?
[snip]
> -int dev_write(void *buf, __u64 offset, size_t len)
> +static int __dev_write(void *buf, __u64 offset, size_t len, enum rw_hint whint)
> {
> + bool set_whint = whint != WRITE_LIFE_NONE;
> + u64 hint = whint;
> int fd;
>
> + fd = __get_device_fd(&offset);
> + if (fd < 0)
> + return fd;
> +
> + if (lseek(fd, (off_t)offset, SEEK_SET) < 0)
> + return -1;
> +
> + if (set_whint)
> + fcntl(fd, F_SET_RW_HINT, &hint);
What about keeping last hint in fd, and update it once new hint is
not same to old one?
Thanks,
_______________________________________________
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:[~2024-08-15 3:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20240809073246epcms2p134ead07aadfe72e7e3506efc5098ad7f@epcms2p1>
2024-08-09 7:32 ` [f2fs-dev] [PATCH] f2fs-tools: add write hint support Daejun Park
2024-08-15 3:33 ` Chao Yu [this message]
[not found] ` <CGME20240809073246epcms2p134ead07aadfe72e7e3506efc5098ad7f@epcms2p7>
2024-08-16 1:32 ` [f2fs-dev] (2) " Daejun Park
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=ce74a0ac-1c64-43db-ae74-eac621982484@kernel.org \
--to=chao@kernel.org \
--cc=daejun7.park@samsung.com \
--cc=dongjin_.kim@samsung.com \
--cc=jaegeuk@kernel.org \
--cc=jeuk20.kim@samsung.com \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=nayeoni.kim@samsung.com \
--cc=siu.jung@samsung.com \
--cc=sukka.kim@samsung.com \
/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).