On 12/26/25 09:52, Chao Yu via Linux-f2fs-devel wrote:
> 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?

Currently, only the call chain f2fs_folio_wait_writeback
-> f2fs_submit_merged_write_cond->__submit_merged_write_cond passes a
non-NULL folio with a NULL inode. When the return value of
__has_merged_page is true and the folio is non-NULL, it indicates the
call is from f2fs_folio_wait_writeback. Indeed, this is unclear.

The force parameter seems redundant, where force = true implies `inode
== NULL && folio == NULL && ino == 0` is true, and force = false implies
`inode != NULL || folio != NULL || ino != 0` is true.

How about removing the force parameter and adding a `bool writeback`
parameter to indicate calls from f2fs_folio_wait_writeback?

Thanks
Yongpeng,

> 
> 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



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

Reply via email to