* [f2fs-dev] [PATCH] Revert "f2fs: use flush command instead of FUA for zoned device"
@ 2024-06-14 0:48 Wenjie Cheng
2024-06-20 3:20 ` Chao Yu
` (3 more replies)
0 siblings, 4 replies; 10+ messages in thread
From: Wenjie Cheng @ 2024-06-14 0:48 UTC (permalink / raw)
To: jaegeuk, chao; +Cc: qwjhust, linux-kernel, Wenjie Cheng, linux-f2fs-devel
This reverts commit c550e25bca660ed2554cbb48d32b82d0bb98e4b1.
Commit c550e25bca660ed2554cbb48d32b82d0bb98e4b1 ("f2fs: use flush
command instead of FUA for zoned device") used additional flush
command to keep write order.
Since Commit dd291d77cc90eb6a86e9860ba8e6e38eebd57d12 ("block:
Introduce zone write plugging") has enabled the block layer to
handle this order issue, there is no need to use flush command.
Signed-off-by: Wenjie Cheng <cwjhust@gmail.com>
---
fs/f2fs/file.c | 3 +--
fs/f2fs/node.c | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index eae2e7908072..f08e6208e183 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -372,8 +372,7 @@ static int f2fs_do_sync_file(struct file *file, loff_t start, loff_t end,
f2fs_remove_ino_entry(sbi, ino, APPEND_INO);
clear_inode_flag(inode, FI_APPEND_WRITE);
flush_out:
- if ((!atomic && F2FS_OPTION(sbi).fsync_mode != FSYNC_MODE_NOBARRIER) ||
- (atomic && !test_opt(sbi, NOBARRIER) && f2fs_sb_has_blkzoned(sbi)))
+ if (!atomic && F2FS_OPTION(sbi).fsync_mode != FSYNC_MODE_NOBARRIER)
ret = f2fs_issue_flush(sbi, inode->i_ino);
if (!ret) {
f2fs_remove_ino_entry(sbi, ino, UPDATE_INO);
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 144f9f966690..c45d341dcf6e 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -1631,7 +1631,7 @@ static int __write_node_page(struct page *page, bool atomic, bool *submitted,
goto redirty_out;
}
- if (atomic && !test_opt(sbi, NOBARRIER) && !f2fs_sb_has_blkzoned(sbi))
+ if (atomic && !test_opt(sbi, NOBARRIER))
fio.op_flags |= REQ_PREFLUSH | REQ_FUA;
/* should add to global list before clearing PAGECACHE status */
--
2.34.1
_______________________________________________
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] 10+ messages in thread
* Re: [f2fs-dev] [PATCH] Revert "f2fs: use flush command instead of FUA for zoned device"
2024-06-14 0:48 [f2fs-dev] [PATCH] Revert "f2fs: use flush command instead of FUA for zoned device" Wenjie Cheng
@ 2024-06-20 3:20 ` Chao Yu
[not found] ` <CGME20240620032223epcas2p4d6b770a8e256d140e5296df8a386418e@epcms2p1>
` (2 subsequent siblings)
3 siblings, 0 replies; 10+ messages in thread
From: Chao Yu @ 2024-06-20 3:20 UTC (permalink / raw)
To: jaegeuk, Wenjie Cheng; +Cc: qwjhust, linux-kernel, linux-f2fs-devel
Jaegeuk,
Quoted commit message from commit c550e25bca66 ("f2fs: use flush command
instead of FUA for zoned device")
"
The block layer for zoned disk can reorder the FUA'ed IOs. Let's use flush
command to keep the write order.
"
It seems mq-deadline use fifo queue and make queue depth of zone device
as 1 to IO order, so why FUA'ed write node IOs can be reordered by block
layer?
Thanks,
On 2024/6/14 8:48, Wenjie Cheng wrote:
> This reverts commit c550e25bca660ed2554cbb48d32b82d0bb98e4b1.
>
> Commit c550e25bca660ed2554cbb48d32b82d0bb98e4b1 ("f2fs: use flush
> command instead of FUA for zoned device") used additional flush
> command to keep write order.
>
> Since Commit dd291d77cc90eb6a86e9860ba8e6e38eebd57d12 ("block:
> Introduce zone write plugging") has enabled the block layer to
> handle this order issue, there is no need to use flush command.
>
> Signed-off-by: Wenjie Cheng <cwjhust@gmail.com>
> ---
> fs/f2fs/file.c | 3 +--
> fs/f2fs/node.c | 2 +-
> 2 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
> index eae2e7908072..f08e6208e183 100644
> --- a/fs/f2fs/file.c
> +++ b/fs/f2fs/file.c
> @@ -372,8 +372,7 @@ static int f2fs_do_sync_file(struct file *file, loff_t start, loff_t end,
> f2fs_remove_ino_entry(sbi, ino, APPEND_INO);
> clear_inode_flag(inode, FI_APPEND_WRITE);
> flush_out:
> - if ((!atomic && F2FS_OPTION(sbi).fsync_mode != FSYNC_MODE_NOBARRIER) ||
> - (atomic && !test_opt(sbi, NOBARRIER) && f2fs_sb_has_blkzoned(sbi)))
> + if (!atomic && F2FS_OPTION(sbi).fsync_mode != FSYNC_MODE_NOBARRIER)
> ret = f2fs_issue_flush(sbi, inode->i_ino);
> if (!ret) {
> f2fs_remove_ino_entry(sbi, ino, UPDATE_INO);
> diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
> index 144f9f966690..c45d341dcf6e 100644
> --- a/fs/f2fs/node.c
> +++ b/fs/f2fs/node.c
> @@ -1631,7 +1631,7 @@ static int __write_node_page(struct page *page, bool atomic, bool *submitted,
> goto redirty_out;
> }
>
> - if (atomic && !test_opt(sbi, NOBARRIER) && !f2fs_sb_has_blkzoned(sbi))
> + if (atomic && !test_opt(sbi, NOBARRIER))
> fio.op_flags |= REQ_PREFLUSH | REQ_FUA;
>
> /* should add to global list before clearing PAGECACHE status */
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [f2fs-dev] (2) [PATCH] Revert "f2fs: use flush command instead of FUA for zoned device"
[not found] ` <CGME20240620032223epcas2p4d6b770a8e256d140e5296df8a386418e@epcms2p1>
@ 2024-06-20 5:56 ` Daejun Park
2024-06-20 7:12 ` Chao Yu
2024-06-20 7:22 ` [f2fs-dev] (2) " Daejun Park
1 sibling, 1 reply; 10+ messages in thread
From: Daejun Park @ 2024-06-20 5:56 UTC (permalink / raw)
To: Chao Yu, jaegeuk@kernel.org, Wenjie Cheng
Cc: qwjhust@gmail.com, linux-kernel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net
Hi Chao,
> Jaegeuk,
>
> Quoted commit message from commit c550e25bca66 ("f2fs: use flush command
> instead of FUA for zoned device")
> "
> The block layer for zoned disk can reorder the FUA'ed IOs. Let's use flush
> command to keep the write order.
> "
>
> It seems mq-deadline use fifo queue and make queue depth of zone device
> as 1 to IO order, so why FUA'ed write node IOs can be reordered by block
> layer?
While other writes are aligned by the mq-deadline, write with FUA is not passed
to the scheduler but handled at the block layer.
Thanks,
Daejun
>
> Thanks,
>
> On 2024/6/14 8:48, Wenjie Cheng wrote:
> > This reverts commit c550e25bca660ed2554cbb48d32b82d0bb98e4b1.
> >
> > Commit c550e25bca660ed2554cbb48d32b82d0bb98e4b1 ("f2fs: use flush
> > command instead of FUA for zoned device") used additional flush
> > command to keep write order.
> >
> > Since Commit dd291d77cc90eb6a86e9860ba8e6e38eebd57d12 ("block:
> > Introduce zone write plugging") has enabled the block layer to
> > handle this order issue, there is no need to use flush command.
> >
> > Signed-off-by: Wenjie Cheng <cwjhust@gmail.com>
> > ---
> > fs/f2fs/file.c 3 +--
> > fs/f2fs/node.c 2 +-
> > 2 files changed, 2 insertions(+), 3 deletions(-)
> >
> > diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
> > index eae2e7908072..f08e6208e183 100644
> > --- a/fs/f2fs/file.c
> > +++ b/fs/f2fs/file.c
> > @@ -372,8 +372,7 @@ static int f2fs_do_sync_file(struct file *file, loff_t start, loff_t end,
> > f2fs_remove_ino_entry(sbi, ino, APPEND_INO);
> > clear_inode_flag(inode, FI_APPEND_WRITE);
> > flush_out:
> > - if ((!atomic && F2FS_OPTION(sbi).fsync_mode != FSYNC_MODE_NOBARRIER)
> > - (atomic && !test_opt(sbi, NOBARRIER) && f2fs_sb_has_blkzoned(sbi)))
> > + if (!atomic && F2FS_OPTION(sbi).fsync_mode != FSYNC_MODE_NOBARRIER)
> > ret = f2fs_issue_flush(sbi, inode->i_ino);
> > if (!ret) {
> > f2fs_remove_ino_entry(sbi, ino, UPDATE_INO);
> > diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
> > index 144f9f966690..c45d341dcf6e 100644
> > --- a/fs/f2fs/node.c
> > +++ b/fs/f2fs/node.c
> > @@ -1631,7 +1631,7 @@ static int __write_node_page(struct page *page, bool atomic, bool *submitted,
> > goto redirty_out;
> > }
> >
> > - if (atomic && !test_opt(sbi, NOBARRIER) && !f2fs_sb_has_blkzoned(sbi))
> > + if (atomic && !test_opt(sbi, NOBARRIER))
> > fio.op_flags = REQ_PREFLUSH REQ_FUA;
> >
> > /* should add to global list before clearing PAGECACHE status */
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [f2fs-dev] (2) [PATCH] Revert "f2fs: use flush command instead of FUA for zoned device"
2024-06-20 5:56 ` [f2fs-dev] (2) " Daejun Park
@ 2024-06-20 7:12 ` Chao Yu
0 siblings, 0 replies; 10+ messages in thread
From: Chao Yu @ 2024-06-20 7:12 UTC (permalink / raw)
To: daejun7.park, jaegeuk@kernel.org, Wenjie Cheng
Cc: qwjhust@gmail.com, linux-kernel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net
On 2024/6/20 13:56, Daejun Park wrote:
> Hi Chao,
>
>> Jaegeuk,
>>
>> Quoted commit message from commit c550e25bca66 ("f2fs: use flush command
>> instead of FUA for zoned device")
>> "
>> The block layer for zoned disk can reorder the FUA'ed IOs. Let's use flush
>> command to keep the write order.
>> "
>>
>> It seems mq-deadline use fifo queue and make queue depth of zone device
>> as 1 to IO order, so why FUA'ed write node IOs can be reordered by block
>> layer?
>
> While other writes are aligned by the mq-deadline, write with FUA is not passed
> to the scheduler but handled at the block layer.
Hi Daejun,
IIUC, do you mean write w/ FUA may be handled directly in below path?
- blk_mq_submit_bio
- op_is_flush && blk_insert_flush
Thanks,
>
> Thanks,
> Daejun
>
>>
>> Thanks,
>>
>> On 2024/6/14 8:48, Wenjie Cheng wrote:
>>> This reverts commit c550e25bca660ed2554cbb48d32b82d0bb98e4b1.
>>>
>>> Commit c550e25bca660ed2554cbb48d32b82d0bb98e4b1 ("f2fs: use flush
>>> command instead of FUA for zoned device") used additional flush
>>> command to keep write order.
>>>
>>> Since Commit dd291d77cc90eb6a86e9860ba8e6e38eebd57d12 ("block:
>>> Introduce zone write plugging") has enabled the block layer to
>>> handle this order issue, there is no need to use flush command.
>>>
>>> Signed-off-by: Wenjie Cheng <cwjhust@gmail.com>
>>> ---
>>> fs/f2fs/file.c 3 +--
>>> fs/f2fs/node.c 2 +-
>>> 2 files changed, 2 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
>>> index eae2e7908072..f08e6208e183 100644
>>> --- a/fs/f2fs/file.c
>>> +++ b/fs/f2fs/file.c
>>> @@ -372,8 +372,7 @@ static int f2fs_do_sync_file(struct file *file, loff_t start, loff_t end,
>>> f2fs_remove_ino_entry(sbi, ino, APPEND_INO);
>>> clear_inode_flag(inode, FI_APPEND_WRITE);
>>> flush_out:
>>> - if ((!atomic && F2FS_OPTION(sbi).fsync_mode != FSYNC_MODE_NOBARRIER)
>>> - (atomic && !test_opt(sbi, NOBARRIER) && f2fs_sb_has_blkzoned(sbi)))
>>> + if (!atomic && F2FS_OPTION(sbi).fsync_mode != FSYNC_MODE_NOBARRIER)
>>> ret = f2fs_issue_flush(sbi, inode->i_ino);
>>> if (!ret) {
>>> f2fs_remove_ino_entry(sbi, ino, UPDATE_INO);
>>> diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
>>> index 144f9f966690..c45d341dcf6e 100644
>>> --- a/fs/f2fs/node.c
>>> +++ b/fs/f2fs/node.c
>>> @@ -1631,7 +1631,7 @@ static int __write_node_page(struct page *page, bool atomic, bool *submitted,
>>> goto redirty_out;
>>> }
>>>
>>> - if (atomic && !test_opt(sbi, NOBARRIER) && !f2fs_sb_has_blkzoned(sbi))
>>> + if (atomic && !test_opt(sbi, NOBARRIER))
>>> fio.op_flags = REQ_PREFLUSH REQ_FUA;
>>>
>>> /* should add to global list before clearing PAGECACHE status */
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [f2fs-dev] (2) (2) [PATCH] Revert "f2fs: use flush command instead of FUA for zoned device"
[not found] ` <CGME20240620032223epcas2p4d6b770a8e256d140e5296df8a386418e@epcms2p1>
2024-06-20 5:56 ` [f2fs-dev] (2) " Daejun Park
@ 2024-06-20 7:22 ` Daejun Park
2024-06-20 7:27 ` Chao Yu
[not found] ` <CGME20240620032223epcas2p4d6b770a8e256d140e5296df8a386418e@epcms2p3>
1 sibling, 2 replies; 10+ messages in thread
From: Daejun Park @ 2024-06-20 7:22 UTC (permalink / raw)
To: Chao Yu, jaegeuk@kernel.org, Wenjie Cheng
Cc: qwjhust@gmail.com, linux-kernel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net
>On 2024/6/20 13:56, Daejun Park wrote:
>> Hi Chao,
>>
>>> Jaegeuk,
>>>
>>> Quoted commit message from commit c550e25bca66 ("f2fs: use flush command
>>> instead of FUA for zoned device")
>>> "
>>> The block layer for zoned disk can reorder the FUA'ed IOs. Let's use flush
>>> command to keep the write order.
>>> "
>>>
>>> It seems mq-deadline use fifo queue and make queue depth of zone device
>>> as 1 to IO order, so why FUA'ed write node IOs can be reordered by block
>>> layer?
>>
>> While other writes are aligned by the mq-deadline, write with FUA is not passed
>> to the scheduler but handled at the block layer.
>
>Hi Daejun,
>
>IIUC, do you mean write w/ FUA may be handled directly in below path?
>
>- blk_mq_submit_bio
> - op_is_flush && blk_insert_flush
Hi Chao,
Yes, I think the path caused an unaligned write when the zone lock was
being applied by mq-deadline.
>
>Thanks,
>
>>
>> Thanks,
>> Daejun
>>
>>>
>>> Thanks,
>>>
>>> On 2024/6/14 8:48, Wenjie Cheng wrote:
>>>> This reverts commit c550e25bca660ed2554cbb48d32b82d0bb98e4b1.
>>>>
>>>> Commit c550e25bca660ed2554cbb48d32b82d0bb98e4b1 ("f2fs: use flush
>>>> command instead of FUA for zoned device") used additional flush
>>>> command to keep write order.
>>>>
>>>> Since Commit dd291d77cc90eb6a86e9860ba8e6e38eebd57d12 ("block:
>>>> Introduce zone write plugging") has enabled the block layer to
>>>> handle this order issue, there is no need to use flush command.
>>>>
>>>> Signed-off-by: Wenjie Cheng <cwjhust@gmail.com>
>>>> ---
>>>> fs/f2fs/file.c 3 +--
>>>> fs/f2fs/node.c 2 +-
>>>> 2 files changed, 2 insertions(+), 3 deletions(-)
>>>>
>>>> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
>>>> index eae2e7908072..f08e6208e183 100644
>>>> --- a/fs/f2fs/file.c
>>>> +++ b/fs/f2fs/file.c
>>>> @@ -372,8 +372,7 @@ static int f2fs_do_sync_file(struct file *file, loff_t start, loff_t end,
>>>> f2fs_remove_ino_entry(sbi, ino, APPEND_INO);
>>>> clear_inode_flag(inode, FI_APPEND_WRITE);
>>>> flush_out:
>>>> - if ((!atomic && F2FS_OPTION(sbi).fsync_mode != FSYNC_MODE_NOBARRIER)
>>>> - (atomic && !test_opt(sbi, NOBARRIER) && f2fs_sb_has_blkzoned(sbi)))
>>>> + if (!atomic && F2FS_OPTION(sbi).fsync_mode != FSYNC_MODE_NOBARRIER)
>>>> ret = f2fs_issue_flush(sbi, inode->i_ino);
>>>> if (!ret) {
>>>> f2fs_remove_ino_entry(sbi, ino, UPDATE_INO);
>>>> diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
>>>> index 144f9f966690..c45d341dcf6e 100644
>>>> --- a/fs/f2fs/node.c
>>>> +++ b/fs/f2fs/node.c
>>>> @@ -1631,7 +1631,7 @@ static int __write_node_page(struct page *page, bool atomic, bool *submitted,
>>>> goto redirty_out;
>>>> }
>>>>
>>>> - if (atomic && !test_opt(sbi, NOBARRIER) && !f2fs_sb_has_blkzoned(sbi))
>>>> + if (atomic && !test_opt(sbi, NOBARRIER))
>>>> fio.op_flags = REQ_PREFLUSH REQ_FUA;
>>>>
>>>> /* should add to global list before clearing PAGECACHE status */
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [f2fs-dev] (2) (2) [PATCH] Revert "f2fs: use flush command instead of FUA for zoned device"
2024-06-20 7:22 ` [f2fs-dev] (2) " Daejun Park
@ 2024-06-20 7:27 ` Chao Yu
[not found] ` <CGME20240620032223epcas2p4d6b770a8e256d140e5296df8a386418e@epcms2p3>
1 sibling, 0 replies; 10+ messages in thread
From: Chao Yu @ 2024-06-20 7:27 UTC (permalink / raw)
To: daejun7.park, jaegeuk@kernel.org, Wenjie Cheng
Cc: qwjhust@gmail.com, linux-kernel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net
On 2024/6/20 15:22, Daejun Park wrote:
>> On 2024/6/20 13:56, Daejun Park wrote:
>>> Hi Chao,
>>>
>>>> Jaegeuk,
>>>>
>>>> Quoted commit message from commit c550e25bca66 ("f2fs: use flush command
>>>> instead of FUA for zoned device")
>>>> "
>>>> The block layer for zoned disk can reorder the FUA'ed IOs. Let's use flush
>>>> command to keep the write order.
>>>> "
>>>>
>>>> It seems mq-deadline use fifo queue and make queue depth of zone device
>>>> as 1 to IO order, so why FUA'ed write node IOs can be reordered by block
>>>> layer?
>>>
>>> While other writes are aligned by the mq-deadline, write with FUA is not passed
>>> to the scheduler but handled at the block layer.
>>
>> Hi Daejun,
>>
>> IIUC, do you mean write w/ FUA may be handled directly in below path?
>>
>> - blk_mq_submit_bio
>> - op_is_flush && blk_insert_flush
>
> Hi Chao,
>
> Yes, I think the path caused an unaligned write when the zone lock was
> being applied by mq-deadline.
But, blk_insert_flush() may return false due to policy should be
REQ_FSEQ_DATA or REQ_FSEQ_DATA | REQ_FSEQ_POSTFLUSH, then
blk_mq_insert_request() after blk_insert_flush() will be called?
Thanks,
>
>>
>> Thanks,
>>
>>>
>>> Thanks,
>>> Daejun
>>>
>>>>
>>>> Thanks,
>>>>
>>>> On 2024/6/14 8:48, Wenjie Cheng wrote:
>>>>> This reverts commit c550e25bca660ed2554cbb48d32b82d0bb98e4b1.
>>>>>
>>>>> Commit c550e25bca660ed2554cbb48d32b82d0bb98e4b1 ("f2fs: use flush
>>>>> command instead of FUA for zoned device") used additional flush
>>>>> command to keep write order.
>>>>>
>>>>> Since Commit dd291d77cc90eb6a86e9860ba8e6e38eebd57d12 ("block:
>>>>> Introduce zone write plugging") has enabled the block layer to
>>>>> handle this order issue, there is no need to use flush command.
>>>>>
>>>>> Signed-off-by: Wenjie Cheng <cwjhust@gmail.com>
>>>>> ---
>>>>> fs/f2fs/file.c 3 +--
>>>>> fs/f2fs/node.c 2 +-
>>>>> 2 files changed, 2 insertions(+), 3 deletions(-)
>>>>>
>>>>> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
>>>>> index eae2e7908072..f08e6208e183 100644
>>>>> --- a/fs/f2fs/file.c
>>>>> +++ b/fs/f2fs/file.c
>>>>> @@ -372,8 +372,7 @@ static int f2fs_do_sync_file(struct file *file, loff_t start, loff_t end,
>>>>> f2fs_remove_ino_entry(sbi, ino, APPEND_INO);
>>>>> clear_inode_flag(inode, FI_APPEND_WRITE);
>>>>> flush_out:
>>>>> - if ((!atomic && F2FS_OPTION(sbi).fsync_mode != FSYNC_MODE_NOBARRIER)
>>>>> - (atomic && !test_opt(sbi, NOBARRIER) && f2fs_sb_has_blkzoned(sbi)))
>>>>> + if (!atomic && F2FS_OPTION(sbi).fsync_mode != FSYNC_MODE_NOBARRIER)
>>>>> ret = f2fs_issue_flush(sbi, inode->i_ino);
>>>>> if (!ret) {
>>>>> f2fs_remove_ino_entry(sbi, ino, UPDATE_INO);
>>>>> diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
>>>>> index 144f9f966690..c45d341dcf6e 100644
>>>>> --- a/fs/f2fs/node.c
>>>>> +++ b/fs/f2fs/node.c
>>>>> @@ -1631,7 +1631,7 @@ static int __write_node_page(struct page *page, bool atomic, bool *submitted,
>>>>> goto redirty_out;
>>>>> }
>>>>>
>>>>> - if (atomic && !test_opt(sbi, NOBARRIER) && !f2fs_sb_has_blkzoned(sbi))
>>>>> + if (atomic && !test_opt(sbi, NOBARRIER))
>>>>> fio.op_flags = REQ_PREFLUSH REQ_FUA;
>>>>>
>>>>> /* should add to global list before clearing PAGECACHE status */
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [f2fs-dev] (2) (2) (2) [PATCH] Revert "f2fs: use flush command instead of FUA for zoned device"
[not found] ` <CGME20240620032223epcas2p4d6b770a8e256d140e5296df8a386418e@epcms2p3>
@ 2024-06-20 7:56 ` Daejun Park
2024-06-20 8:01 ` Chao Yu
0 siblings, 1 reply; 10+ messages in thread
From: Daejun Park @ 2024-06-20 7:56 UTC (permalink / raw)
To: Chao Yu, jaegeuk@kernel.org, Wenjie Cheng
Cc: qwjhust@gmail.com, linux-kernel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net
>On 2024/6/20 15:22, Daejun Park wrote:
>>> On 2024/6/20 13:56, Daejun Park wrote:
>>>> Hi Chao,
>>>>
>>>>> Jaegeuk,
>>>>>
>>>>> Quoted commit message from commit c550e25bca66 ("f2fs: use flush command
>>>>> instead of FUA for zoned device")
>>>>> "
>>>>> The block layer for zoned disk can reorder the FUA'ed IOs. Let's use flush
>>>>> command to keep the write order.
>>>>> "
>>>>>
>>>>> It seems mq-deadline use fifo queue and make queue depth of zone device
>>>>> as 1 to IO order, so why FUA'ed write node IOs can be reordered by block
>>>>> layer?
>>>>
>>>> While other writes are aligned by the mq-deadline, write with FUA is not passed
>>>> to the scheduler but handled at the block layer.
>>>
>>> Hi Daejun,
>>>
>>> IIUC, do you mean write w/ FUA may be handled directly in below path?
>>>
>>> - blk_mq_submit_bio
>>> - op_is_flush && blk_insert_flush
>>
>> Hi Chao,
>>
>> Yes, I think the path caused an unaligned write when the zone lock was
>> being applied by mq-deadline.
>
>But, blk_insert_flush() may return false due to policy should be
>REQ_FSEQ_DATA or REQ_FSEQ_DATA REQ_FSEQ_POSTFLUSH, then
>blk_mq_insert_request() after blk_insert_flush() will be called?
>
I was just discussing the handling of FUAs in commit c550e25bca66,
which is not an issue in the current code as FUAs are handled correctly.
Thanks,
>Thanks,
>
>>
>>>
>>> Thanks,
>>>
>>>>
>>>> Thanks,
>>>> Daejun
>>>>
>>>>>
>>>>> Thanks,
>>>>>
>>>>> On 2024/6/14 8:48, Wenjie Cheng wrote:
>>>>>> This reverts commit c550e25bca660ed2554cbb48d32b82d0bb98e4b1.
>>>>>>
>>>>>> Commit c550e25bca660ed2554cbb48d32b82d0bb98e4b1 ("f2fs: use flush
>>>>>> command instead of FUA for zoned device") used additional flush
>>>>>> command to keep write order.
>>>>>>
>>>>>> Since Commit dd291d77cc90eb6a86e9860ba8e6e38eebd57d12 ("block:
>>>>>> Introduce zone write plugging") has enabled the block layer to
>>>>>> handle this order issue, there is no need to use flush command.
>>>>>>
>>>>>> Signed-off-by: Wenjie Cheng <cwjhust@gmail.com>
>>>>>> ---
>>>>>> fs/f2fs/file.c 3 +--
>>>>>> fs/f2fs/node.c 2 +-
>>>>>> 2 files changed, 2 insertions(+), 3 deletions(-)
>>>>>>
>>>>>> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
>>>>>> index eae2e7908072..f08e6208e183 100644
>>>>>> --- a/fs/f2fs/file.c
>>>>>> +++ b/fs/f2fs/file.c
>>>>>> @@ -372,8 +372,7 @@ static int f2fs_do_sync_file(struct file *file, loff_t start, loff_t end,
>>>>>> f2fs_remove_ino_entry(sbi, ino, APPEND_INO);
>>>>>> clear_inode_flag(inode, FI_APPEND_WRITE);
>>>>>> flush_out:
>>>>>> - if ((!atomic && F2FS_OPTION(sbi).fsync_mode != FSYNC_MODE_NOBARRIER)
>>>>>> - (atomic && !test_opt(sbi, NOBARRIER) && f2fs_sb_has_blkzoned(sbi)))
>>>>>> + if (!atomic && F2FS_OPTION(sbi).fsync_mode != FSYNC_MODE_NOBARRIER)
>>>>>> ret = f2fs_issue_flush(sbi, inode->i_ino);
>>>>>> if (!ret) {
>>>>>> f2fs_remove_ino_entry(sbi, ino, UPDATE_INO);
>>>>>> diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
>>>>>> index 144f9f966690..c45d341dcf6e 100644
>>>>>> --- a/fs/f2fs/node.c
>>>>>> +++ b/fs/f2fs/node.c
>>>>>> @@ -1631,7 +1631,7 @@ static int __write_node_page(struct page *page, bool atomic, bool *submitted,
>>>>>> goto redirty_out;
>>>>>> }
>>>>>>
>>>>>> - if (atomic && !test_opt(sbi, NOBARRIER) && !f2fs_sb_has_blkzoned(sbi))
>>>>>> + if (atomic && !test_opt(sbi, NOBARRIER))
>>>>>> fio.op_flags = REQ_PREFLUSH REQ_FUA;
>>>>>>
>>>>>> /* should add to global list before clearing PAGECACHE status */
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [f2fs-dev] (2) (2) (2) [PATCH] Revert "f2fs: use flush command instead of FUA for zoned device"
2024-06-20 7:56 ` [f2fs-dev] (2) " Daejun Park
@ 2024-06-20 8:01 ` Chao Yu
0 siblings, 0 replies; 10+ messages in thread
From: Chao Yu @ 2024-06-20 8:01 UTC (permalink / raw)
To: daejun7.park, jaegeuk@kernel.org, Wenjie Cheng
Cc: qwjhust@gmail.com, linux-kernel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net
On 2024/6/20 15:56, Daejun Park wrote:
>> On 2024/6/20 15:22, Daejun Park wrote:
>>>> On 2024/6/20 13:56, Daejun Park wrote:
>>>>> Hi Chao,
>>>>>
>>>>>> Jaegeuk,
>>>>>>
>>>>>> Quoted commit message from commit c550e25bca66 ("f2fs: use flush command
>>>>>> instead of FUA for zoned device")
>>>>>> "
>>>>>> The block layer for zoned disk can reorder the FUA'ed IOs. Let's use flush
>>>>>> command to keep the write order.
>>>>>> "
>>>>>>
>>>>>> It seems mq-deadline use fifo queue and make queue depth of zone device
>>>>>> as 1 to IO order, so why FUA'ed write node IOs can be reordered by block
>>>>>> layer?
>>>>>
>>>>> While other writes are aligned by the mq-deadline, write with FUA is not passed
>>>>> to the scheduler but handled at the block layer.
>>>>
>>>> Hi Daejun,
>>>>
>>>> IIUC, do you mean write w/ FUA may be handled directly in below path?
>>>>
>>>> - blk_mq_submit_bio
>>>> - op_is_flush && blk_insert_flush
>>>
>>> Hi Chao,
>>>
>>> Yes, I think the path caused an unaligned write when the zone lock was
>>> being applied by mq-deadline.
>>
>> But, blk_insert_flush() may return false due to policy should be
>> REQ_FSEQ_DATA or REQ_FSEQ_DATA REQ_FSEQ_POSTFLUSH, then
>> blk_mq_insert_request() after blk_insert_flush() will be called?
>>
>
> I was just discussing the handling of FUAs in commit c550e25bca66,
> which is not an issue in the current code as FUAs are handled correctly.
Yup, I think it needs to be reverted. :)
Thanks,
>
> Thanks,
>
>
>> Thanks,
>>
>>>
>>>>
>>>> Thanks,
>>>>
>>>>>
>>>>> Thanks,
>>>>> Daejun
>>>>>
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> On 2024/6/14 8:48, Wenjie Cheng wrote:
>>>>>>> This reverts commit c550e25bca660ed2554cbb48d32b82d0bb98e4b1.
>>>>>>>
>>>>>>> Commit c550e25bca660ed2554cbb48d32b82d0bb98e4b1 ("f2fs: use flush
>>>>>>> command instead of FUA for zoned device") used additional flush
>>>>>>> command to keep write order.
>>>>>>>
>>>>>>> Since Commit dd291d77cc90eb6a86e9860ba8e6e38eebd57d12 ("block:
>>>>>>> Introduce zone write plugging") has enabled the block layer to
>>>>>>> handle this order issue, there is no need to use flush command.
>>>>>>>
>>>>>>> Signed-off-by: Wenjie Cheng <cwjhust@gmail.com>
>>>>>>> ---
>>>>>>> fs/f2fs/file.c 3 +--
>>>>>>> fs/f2fs/node.c 2 +-
>>>>>>> 2 files changed, 2 insertions(+), 3 deletions(-)
>>>>>>>
>>>>>>> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
>>>>>>> index eae2e7908072..f08e6208e183 100644
>>>>>>> --- a/fs/f2fs/file.c
>>>>>>> +++ b/fs/f2fs/file.c
>>>>>>> @@ -372,8 +372,7 @@ static int f2fs_do_sync_file(struct file *file, loff_t start, loff_t end,
>>>>>>> f2fs_remove_ino_entry(sbi, ino, APPEND_INO);
>>>>>>> clear_inode_flag(inode, FI_APPEND_WRITE);
>>>>>>> flush_out:
>>>>>>> - if ((!atomic && F2FS_OPTION(sbi).fsync_mode != FSYNC_MODE_NOBARRIER)
>>>>>>> - (atomic && !test_opt(sbi, NOBARRIER) && f2fs_sb_has_blkzoned(sbi)))
>>>>>>> + if (!atomic && F2FS_OPTION(sbi).fsync_mode != FSYNC_MODE_NOBARRIER)
>>>>>>> ret = f2fs_issue_flush(sbi, inode->i_ino);
>>>>>>> if (!ret) {
>>>>>>> f2fs_remove_ino_entry(sbi, ino, UPDATE_INO);
>>>>>>> diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
>>>>>>> index 144f9f966690..c45d341dcf6e 100644
>>>>>>> --- a/fs/f2fs/node.c
>>>>>>> +++ b/fs/f2fs/node.c
>>>>>>> @@ -1631,7 +1631,7 @@ static int __write_node_page(struct page *page, bool atomic, bool *submitted,
>>>>>>> goto redirty_out;
>>>>>>> }
>>>>>>>
>>>>>>> - if (atomic && !test_opt(sbi, NOBARRIER) && !f2fs_sb_has_blkzoned(sbi))
>>>>>>> + if (atomic && !test_opt(sbi, NOBARRIER))
>>>>>>> fio.op_flags = REQ_PREFLUSH REQ_FUA;
>>>>>>>
>>>>>>> /* should add to global list before clearing PAGECACHE status */
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [f2fs-dev] [PATCH] Revert "f2fs: use flush command instead of FUA for zoned device"
2024-06-14 0:48 [f2fs-dev] [PATCH] Revert "f2fs: use flush command instead of FUA for zoned device" Wenjie Cheng
2024-06-20 3:20 ` Chao Yu
[not found] ` <CGME20240620032223epcas2p4d6b770a8e256d140e5296df8a386418e@epcms2p1>
@ 2024-07-26 1:11 ` Chao Yu
2024-08-05 23:30 ` patchwork-bot+f2fs
3 siblings, 0 replies; 10+ messages in thread
From: Chao Yu @ 2024-07-26 1:11 UTC (permalink / raw)
To: Wenjie Cheng, jaegeuk; +Cc: qwjhust, linux-kernel, linux-f2fs-devel
On 2024/6/14 8:48, Wenjie Cheng wrote:
> This reverts commit c550e25bca660ed2554cbb48d32b82d0bb98e4b1.
>
> Commit c550e25bca660ed2554cbb48d32b82d0bb98e4b1 ("f2fs: use flush
> command instead of FUA for zoned device") used additional flush
> command to keep write order.
>
> Since Commit dd291d77cc90eb6a86e9860ba8e6e38eebd57d12 ("block:
> Introduce zone write plugging") has enabled the block layer to
> handle this order issue, there is no need to use flush command.
>
> Signed-off-by: Wenjie Cheng <cwjhust@gmail.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Thanks,
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [f2fs-dev] [PATCH] Revert "f2fs: use flush command instead of FUA for zoned device"
2024-06-14 0:48 [f2fs-dev] [PATCH] Revert "f2fs: use flush command instead of FUA for zoned device" Wenjie Cheng
` (2 preceding siblings ...)
2024-07-26 1:11 ` [f2fs-dev] " Chao Yu
@ 2024-08-05 23:30 ` patchwork-bot+f2fs
3 siblings, 0 replies; 10+ messages in thread
From: patchwork-bot+f2fs @ 2024-08-05 23:30 UTC (permalink / raw)
To: Wenjie Cheng; +Cc: qwjhust, jaegeuk, linux-kernel, linux-f2fs-devel
Hello:
This patch was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <jaegeuk@kernel.org>:
On Fri, 14 Jun 2024 00:48:41 +0000 you wrote:
> This reverts commit c550e25bca660ed2554cbb48d32b82d0bb98e4b1.
>
> Commit c550e25bca660ed2554cbb48d32b82d0bb98e4b1 ("f2fs: use flush
> command instead of FUA for zoned device") used additional flush
> command to keep write order.
>
> Since Commit dd291d77cc90eb6a86e9860ba8e6e38eebd57d12 ("block:
> Introduce zone write plugging") has enabled the block layer to
> handle this order issue, there is no need to use flush command.
>
> [...]
Here is the summary with links:
- [f2fs-dev] Revert "f2fs: use flush command instead of FUA for zoned device"
https://git.kernel.org/jaegeuk/f2fs/c/2a331ab343ee
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2024-08-05 23:31 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-14 0:48 [f2fs-dev] [PATCH] Revert "f2fs: use flush command instead of FUA for zoned device" Wenjie Cheng
2024-06-20 3:20 ` Chao Yu
[not found] ` <CGME20240620032223epcas2p4d6b770a8e256d140e5296df8a386418e@epcms2p1>
2024-06-20 5:56 ` [f2fs-dev] (2) " Daejun Park
2024-06-20 7:12 ` Chao Yu
2024-06-20 7:22 ` [f2fs-dev] (2) " Daejun Park
2024-06-20 7:27 ` Chao Yu
[not found] ` <CGME20240620032223epcas2p4d6b770a8e256d140e5296df8a386418e@epcms2p3>
2024-06-20 7:56 ` [f2fs-dev] (2) " Daejun Park
2024-06-20 8:01 ` Chao Yu
2024-07-26 1:11 ` [f2fs-dev] " Chao Yu
2024-08-05 23:30 ` patchwork-bot+f2fs
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).