From: Jaegeuk Kim via Linux-f2fs-devel <linux-f2fs-devel@lists.sourceforge.net>
To: Chao Yu <chao@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH 2/3] f2fs: zone: allow IPU for regular file in regular block device
Date: Mon, 21 Oct 2024 23:18:41 +0000 [thread overview]
Message-ID: <ZxbhUUuKx_zaWAx4@google.com> (raw)
In-Reply-To: <20241018062638.2619214-2-chao@kernel.org>
On 10/18, Chao Yu wrote:
> blkzoned feature enables lfs mode by default, for data updates from
> regular file, it only allow to use OPU, this patch changes to allow
> to use IPU if regular file's data block locates in regular block
> device, if data block locates in zoned block device, it still uses
> OPU.
>
> Signed-off-by: Chao Yu <chao@kernel.org>
> ---
> fs/f2fs/data.c | 12 ++++++++++--
> fs/f2fs/f2fs.h | 5 +++++
> 2 files changed, 15 insertions(+), 2 deletions(-)
>
> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> index 949b6bb957c7..c6d0e4aa12e3 100644
> --- a/fs/f2fs/data.c
> +++ b/fs/f2fs/data.c
> @@ -2648,8 +2648,16 @@ bool f2fs_should_update_outplace(struct inode *inode, struct f2fs_io_info *fio)
> return false;
> if (fio && is_sbi_flag_set(sbi, SBI_NEED_FSCK))
> return true;
> - if (f2fs_lfs_mode(sbi))
> - return true;
> + if (f2fs_lfs_mode(sbi)) {
> + /* no regular block device in mainarea */
> + if (!f2fs_blkzoned_has_regular_section(sbi))
> + return true;
> + /* blkaddr locates in sequential zone */
> + if (fio && __is_valid_data_blkaddr(fio->old_blkaddr) &&
> + GET_SEGNO(sbi, fio->old_blkaddr) >=
> + sbi->first_zoned_segno)
What if there's another regular device beyond zoned partition?
I prefer to keep the entire area as lfs mode to simplify the performance.
Do we really need IPU on conventional partition? Why not asking to use
file pinning, if someone needs IPU?
> + return true;
> + }
> if (S_ISDIR(inode->i_mode))
> return true;
> if (IS_NOQUOTA(inode))
> diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
> index 55bcd411257a..6781b4fab43f 100644
> --- a/fs/f2fs/f2fs.h
> +++ b/fs/f2fs/f2fs.h
> @@ -4790,6 +4790,11 @@ static inline void f2fs_invalidate_internal_cache(struct f2fs_sb_info *sbi,
> f2fs_invalidate_compress_page(sbi, blkaddr);
> }
>
> +static inline bool f2fs_blkzoned_has_regular_section(struct f2fs_sb_info *sbi)
> +{
> + return f2fs_sb_has_blkzoned(sbi) && sbi->first_zoned_segno;
> +}
> +
> #define EFSBADCRC EBADMSG /* Bad CRC detected */
> #define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
>
> --
> 2.40.1
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
WARNING: multiple messages have this Message-ID (diff)
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Chao Yu <chao@kernel.org>
Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] f2fs: zone: allow IPU for regular file in regular block device
Date: Mon, 21 Oct 2024 23:18:41 +0000 [thread overview]
Message-ID: <ZxbhUUuKx_zaWAx4@google.com> (raw)
In-Reply-To: <20241018062638.2619214-2-chao@kernel.org>
On 10/18, Chao Yu wrote:
> blkzoned feature enables lfs mode by default, for data updates from
> regular file, it only allow to use OPU, this patch changes to allow
> to use IPU if regular file's data block locates in regular block
> device, if data block locates in zoned block device, it still uses
> OPU.
>
> Signed-off-by: Chao Yu <chao@kernel.org>
> ---
> fs/f2fs/data.c | 12 ++++++++++--
> fs/f2fs/f2fs.h | 5 +++++
> 2 files changed, 15 insertions(+), 2 deletions(-)
>
> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> index 949b6bb957c7..c6d0e4aa12e3 100644
> --- a/fs/f2fs/data.c
> +++ b/fs/f2fs/data.c
> @@ -2648,8 +2648,16 @@ bool f2fs_should_update_outplace(struct inode *inode, struct f2fs_io_info *fio)
> return false;
> if (fio && is_sbi_flag_set(sbi, SBI_NEED_FSCK))
> return true;
> - if (f2fs_lfs_mode(sbi))
> - return true;
> + if (f2fs_lfs_mode(sbi)) {
> + /* no regular block device in mainarea */
> + if (!f2fs_blkzoned_has_regular_section(sbi))
> + return true;
> + /* blkaddr locates in sequential zone */
> + if (fio && __is_valid_data_blkaddr(fio->old_blkaddr) &&
> + GET_SEGNO(sbi, fio->old_blkaddr) >=
> + sbi->first_zoned_segno)
What if there's another regular device beyond zoned partition?
I prefer to keep the entire area as lfs mode to simplify the performance.
Do we really need IPU on conventional partition? Why not asking to use
file pinning, if someone needs IPU?
> + return true;
> + }
> if (S_ISDIR(inode->i_mode))
> return true;
> if (IS_NOQUOTA(inode))
> diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
> index 55bcd411257a..6781b4fab43f 100644
> --- a/fs/f2fs/f2fs.h
> +++ b/fs/f2fs/f2fs.h
> @@ -4790,6 +4790,11 @@ static inline void f2fs_invalidate_internal_cache(struct f2fs_sb_info *sbi,
> f2fs_invalidate_compress_page(sbi, blkaddr);
> }
>
> +static inline bool f2fs_blkzoned_has_regular_section(struct f2fs_sb_info *sbi)
> +{
> + return f2fs_sb_has_blkzoned(sbi) && sbi->first_zoned_segno;
> +}
> +
> #define EFSBADCRC EBADMSG /* Bad CRC detected */
> #define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
>
> --
> 2.40.1
next prev parent reply other threads:[~2024-10-21 23:18 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-18 6:26 [f2fs-dev] [PATCH 1/3] f2fs: zone: introduce first_zoned_segno in f2fs_sb_info Chao Yu via Linux-f2fs-devel
2024-10-18 6:26 ` Chao Yu
2024-10-18 6:26 ` [f2fs-dev] [PATCH 2/3] f2fs: zone: allow IPU for regular file in regular block device Chao Yu via Linux-f2fs-devel
2024-10-18 6:26 ` Chao Yu
2024-10-21 23:18 ` Jaegeuk Kim via Linux-f2fs-devel [this message]
2024-10-21 23:18 ` Jaegeuk Kim
2024-10-22 1:58 ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2024-10-22 1:58 ` Chao Yu
2024-10-18 6:26 ` [f2fs-dev] [PATCH 3/3] f2fs: support NOCoW flag Chao Yu via Linux-f2fs-devel
2024-10-18 6:26 ` Chao Yu
2024-10-28 17:40 ` [f2fs-dev] [PATCH 1/3] f2fs: zone: introduce first_zoned_segno in f2fs_sb_info patchwork-bot+f2fs--- via Linux-f2fs-devel
2024-10-28 17:40 ` patchwork-bot+f2fs
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=ZxbhUUuKx_zaWAx4@google.com \
--to=linux-f2fs-devel@lists.sourceforge.net \
--cc=chao@kernel.org \
--cc=jaegeuk@kernel.org \
--cc=linux-kernel@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.