From: Chao Yu <chao@kernel.org>
To: qixiaoyu1 <qxy65535@gmail.com>, Jaegeuk Kim <jaegeuk@kernel.org>
Cc: qixiaoyu1 <qixiaoyu1@xiaomi.com>,
linux-kernel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH] f2fs: separate IPU policy for fdatasync from F2FS_IPU_FSYNC
Date: Tue, 1 Nov 2022 23:14:55 +0800 [thread overview]
Message-ID: <af41e68c-4f78-0934-1041-974e44bd3825@kernel.org> (raw)
In-Reply-To: <20221021023136.22863-1-qixiaoyu1@xiaomi.com>
On 2022/10/21 10:31, qixiaoyu1 wrote:
> Currently IPU policy for fdatasync is coupled with F2FS_IPU_FSYNC.
> Fix to apply it to all IPU policy.
Xiaoyu,
Sorry for the delay.
I didn't get the point, can you please explain more about the
issue?
Thanks,
>
> Signed-off-by: qixiaoyu1 <qixiaoyu1@xiaomi.com>
> ---
> fs/f2fs/data.c | 8 +++-----
> fs/f2fs/file.c | 4 +++-
> 2 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> index a71e818cd67b..fec8e15fe820 100644
> --- a/fs/f2fs/data.c
> +++ b/fs/f2fs/data.c
> @@ -2518,6 +2518,9 @@ static inline bool check_inplace_update_policy(struct inode *inode,
> if (policy & (0x1 << F2FS_IPU_HONOR_OPU_WRITE) &&
> is_inode_flag_set(inode, FI_OPU_WRITE))
> return false;
> + /* this is set by fdatasync or F2FS_IPU_FSYNC policy */
> + if (is_inode_flag_set(inode, FI_NEED_IPU))
> + return true;
> if (policy & (0x1 << F2FS_IPU_FORCE))
> return true;
> if (policy & (0x1 << F2FS_IPU_SSR) && f2fs_need_SSR(sbi))
> @@ -2538,11 +2541,6 @@ static inline bool check_inplace_update_policy(struct inode *inode,
> !IS_ENCRYPTED(inode))
> return true;
>
> - /* this is only set during fdatasync */
> - if (policy & (0x1 << F2FS_IPU_FSYNC) &&
> - is_inode_flag_set(inode, FI_NEED_IPU))
> - return true;
> -
> if (unlikely(fio && is_sbi_flag_set(sbi, SBI_CP_DISABLED) &&
> !f2fs_is_checkpointed_data(sbi, fio->old_blkaddr)))
> return true;
> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
> index 82cda1258227..08091550cdf2 100644
> --- a/fs/f2fs/file.c
> +++ b/fs/f2fs/file.c
> @@ -270,8 +270,10 @@ static int f2fs_do_sync_file(struct file *file, loff_t start, loff_t end,
> goto go_write;
>
> /* if fdatasync is triggered, let's do in-place-update */
> - if (datasync || get_dirty_pages(inode) <= SM_I(sbi)->min_fsync_blocks)
> + if (datasync || (SM_I(sbi)->ipu_policy & (0x1 << F2FS_IPU_FSYNC) &&
> + get_dirty_pages(inode) <= SM_I(sbi)->min_fsync_blocks))
> set_inode_flag(inode, FI_NEED_IPU);
> +
> ret = file_write_and_wait_range(file, start, end);
> clear_inode_flag(inode, FI_NEED_IPU);
>
_______________________________________________
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:[~2022-11-01 15:15 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-21 2:31 [f2fs-dev] [PATCH] f2fs: separate IPU policy for fdatasync from F2FS_IPU_FSYNC qixiaoyu1
2022-10-31 11:27 ` qixiaoyu
2022-11-01 15:14 ` Chao Yu [this message]
2022-11-02 12:25 ` qixiaoyu
2022-11-06 13:54 ` Chao Yu
2022-11-08 12:32 ` qixiaoyu
2022-11-08 14:30 ` Chao Yu
2022-11-09 12:56 ` qixiaoyu
2022-11-09 13:39 ` Chao Yu
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=af41e68c-4f78-0934-1041-974e44bd3825@kernel.org \
--to=chao@kernel.org \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=qixiaoyu1@xiaomi.com \
--cc=qxy65535@gmail.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).