On 12/25/2025 8:59 PM, Yongpeng Yang wrote:
From: Yongpeng Yang <[email protected]>

f2fs_folio_wait_writeback ensures the folio write is submitted to the

Actually, __submit_merged_write_cond() was called from many other places,
for those scenario, we can not ensure whether the DATA or NODE type pages
were cached in one bio cache or not, so we decide to submit all cached bios
w/ DATA or NODE type.

block layer via __submit_merged_write_cond, then waits for the folio to
complete. Other I/O submissions are irrelevant to
f2fs_folio_wait_writeback. Thus, if the folio write bio is already

For f2fs_folio_wait_writeback() case, I guess you can optimize it separately,
maybe passing a parameter to __submit_merged_write_cond() as a hint?

Thanks,

submitted, the function can return immediately.

Signed-off-by: Yongpeng Yang <[email protected]>
---
  fs/f2fs/data.c | 6 +++++-
  1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 12bf4b6e0075..c743352b686d 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -678,8 +678,12 @@ static void __submit_merged_write_cond(struct f2fs_sb_info 
*sbi,
                        ret = __has_merged_page(io->bio, inode, folio, ino);
                        f2fs_up_read(&io->io_rwsem);
                }
-               if (ret)
+               if (ret) {
                        __f2fs_submit_merged_write(sbi, type, temp);
+                       /* don't need to submit other types of bio. */
+                       if (folio)
+                               break;
+               }
/* TODO: use HOT temp only for meta pages now. */
                if (type >= META)



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to