* [PATCH] f2fs: enable nowait async buffered writes
@ 2023-05-31 14:40 Yangtao Li
2023-06-06 6:43 ` Chao Yu
0 siblings, 1 reply; 4+ messages in thread
From: Yangtao Li @ 2023-05-31 14:40 UTC (permalink / raw)
To: Jaegeuk Kim, Chao Yu
Cc: Yangtao Li, Lu Hongfei, linux-f2fs-devel, linux-kernel
This adds the async buffered write support to f2fs,
the following is the relevant test data.
iodepth | 1 | 2 | 4 | 8 | 16 |
before(M/s) | 1012 | 1133 | 894 | 981 | 866 |
after(M/s) | 1488 | 1896 | 2081 | 2188 | 2207 |
Signed-off-by: Lu Hongfei <luhongfei@vivo.com>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
fs/f2fs/file.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 23c68ee946e5..4faf2c04e325 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -546,7 +546,7 @@ static int f2fs_file_open(struct inode *inode, struct file *filp)
if (err)
return err;
- filp->f_mode |= FMODE_NOWAIT | FMODE_BUF_RASYNC;
+ filp->f_mode |= FMODE_NOWAIT | FMODE_BUF_RASYNC | FMODE_BUF_WASYNC;
return dquot_file_open(inode, filp);
}
@@ -4515,9 +4515,6 @@ static ssize_t f2fs_buffered_write_iter(struct kiocb *iocb,
struct inode *inode = file_inode(file);
ssize_t ret;
- if (iocb->ki_flags & IOCB_NOWAIT)
- return -EOPNOTSUPP;
-
current->backing_dev_info = inode_to_bdi(inode);
ret = generic_perform_write(iocb, from);
current->backing_dev_info = NULL;
--
2.39.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] f2fs: enable nowait async buffered writes
2023-05-31 14:40 [PATCH] f2fs: enable nowait async buffered writes Yangtao Li
@ 2023-06-06 6:43 ` Chao Yu
2023-06-06 11:13 ` Yangtao Li
0 siblings, 1 reply; 4+ messages in thread
From: Chao Yu @ 2023-06-06 6:43 UTC (permalink / raw)
To: Yangtao Li, Jaegeuk Kim; +Cc: Lu Hongfei, linux-f2fs-devel, linux-kernel
On 2023/5/31 22:40, Yangtao Li wrote:
> This adds the async buffered write support to f2fs,
> the following is the relevant test data.
Yangtao,
Could you please provide detailed test command?
Thanks,
>
> iodepth | 1 | 2 | 4 | 8 | 16 |
> before(M/s) | 1012 | 1133 | 894 | 981 | 866 |
> after(M/s) | 1488 | 1896 | 2081 | 2188 | 2207 |
>
> Signed-off-by: Lu Hongfei <luhongfei@vivo.com>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
> fs/f2fs/file.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
> index 23c68ee946e5..4faf2c04e325 100644
> --- a/fs/f2fs/file.c
> +++ b/fs/f2fs/file.c
> @@ -546,7 +546,7 @@ static int f2fs_file_open(struct inode *inode, struct file *filp)
> if (err)
> return err;
>
> - filp->f_mode |= FMODE_NOWAIT | FMODE_BUF_RASYNC;
> + filp->f_mode |= FMODE_NOWAIT | FMODE_BUF_RASYNC | FMODE_BUF_WASYNC;
>
> return dquot_file_open(inode, filp);
> }
> @@ -4515,9 +4515,6 @@ static ssize_t f2fs_buffered_write_iter(struct kiocb *iocb,
> struct inode *inode = file_inode(file);
> ssize_t ret;
>
> - if (iocb->ki_flags & IOCB_NOWAIT)
> - return -EOPNOTSUPP;
> -
> current->backing_dev_info = inode_to_bdi(inode);
> ret = generic_perform_write(iocb, from);
> current->backing_dev_info = NULL;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] f2fs: enable nowait async buffered writes
2023-06-06 6:43 ` Chao Yu
@ 2023-06-06 11:13 ` Yangtao Li
2023-06-08 9:38 ` Chao Yu
0 siblings, 1 reply; 4+ messages in thread
From: Yangtao Li @ 2023-06-06 11:13 UTC (permalink / raw)
To: Chao Yu, Jaegeuk Kim; +Cc: Lu Hongfei, linux-f2fs-devel, linux-kernel
On 2023/6/6 14:43, Chao Yu wrote:
> On 2023/5/31 22:40, Yangtao Li wrote:
>> This adds the async buffered write support to f2fs,
>> the following is the relevant test data.
>
> Yangtao,
>
> Could you please provide detailed test command?
Use fio to test, the following is the configuration:
# io_uring
[global]
ioengine=io_uring
sqthread_poll=1
threads=1
iodepth=32
hipri=0
direct=0
fixedbufs=0
uncached=0
nowait=0
force_async=0
randrepeat=0
time_based=0
size=256M
filename=/data/test/local/io_uring_test
group_reporting
[read256B-rand]
bs=4096
rw=randwrite
numjobs=1
>
> Thanks,
>
>>
>> iodepth | 1 | 2 | 4 | 8 | 16 |
>> before(M/s) | 1012 | 1133 | 894 | 981 | 866 |
>> after(M/s) | 1488 | 1896 | 2081 | 2188 | 2207 |
>>
>> Signed-off-by: Lu Hongfei <luhongfei@vivo.com>
>> Signed-off-by: Yangtao Li <frank.li@vivo.com>
>> ---
>> fs/f2fs/file.c | 5 +----
>> 1 file changed, 1 insertion(+), 4 deletions(-)
>>
>> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
>> index 23c68ee946e5..4faf2c04e325 100644
>> --- a/fs/f2fs/file.c
>> +++ b/fs/f2fs/file.c
>> @@ -546,7 +546,7 @@ static int f2fs_file_open(struct inode *inode,
>> struct file *filp)
>> if (err)
>> return err;
>> - filp->f_mode |= FMODE_NOWAIT | FMODE_BUF_RASYNC;
>> + filp->f_mode |= FMODE_NOWAIT | FMODE_BUF_RASYNC | FMODE_BUF_WASYNC;
>> return dquot_file_open(inode, filp);
>> }
>> @@ -4515,9 +4515,6 @@ static ssize_t f2fs_buffered_write_iter(struct
>> kiocb *iocb,
>> struct inode *inode = file_inode(file);
>> ssize_t ret;
>> - if (iocb->ki_flags & IOCB_NOWAIT)
>> - return -EOPNOTSUPP;
>> -
>> current->backing_dev_info = inode_to_bdi(inode);
>> ret = generic_perform_write(iocb, from);
>> current->backing_dev_info = NULL;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] f2fs: enable nowait async buffered writes
2023-06-06 11:13 ` Yangtao Li
@ 2023-06-08 9:38 ` Chao Yu
0 siblings, 0 replies; 4+ messages in thread
From: Chao Yu @ 2023-06-08 9:38 UTC (permalink / raw)
To: Yangtao Li, Jaegeuk Kim; +Cc: Lu Hongfei, linux-f2fs-devel, linux-kernel
On 2023/6/6 19:13, Yangtao Li wrote:
> On 2023/6/6 14:43, Chao Yu wrote:
>
>> On 2023/5/31 22:40, Yangtao Li wrote:
>>> This adds the async buffered write support to f2fs,
>>> the following is the relevant test data.
>>
>> Yangtao,
>>
>> Could you please provide detailed test command?
>
>
> Use fio to test, the following is the configuration:
>
> # io_uring
> [global]
> ioengine=io_uring
> sqthread_poll=1
> threads=1
> iodepth=32
> hipri=0
> direct=0
> fixedbufs=0
> uncached=0
> nowait=0
> force_async=0
> randrepeat=0
> time_based=0
> size=256M
> filename=/data/test/local/io_uring_test
> group_reporting
> [read256B-rand]
> bs=4096
> rw=randwrite
> numjobs=1
Thanks, it looks the performance is not very stable when iodepth is
large, e.g. 32.
Could you please add above test parameter into commit message?
Otherwise, this patch looks good to me.
Thanks,
>
>
>>
>> Thanks,
>>
>>>
>>> iodepth | 1 | 2 | 4 | 8 | 16 |
>>> before(M/s) | 1012 | 1133 | 894 | 981 | 866 |
>>> after(M/s) | 1488 | 1896 | 2081 | 2188 | 2207 |
>>>
>>> Signed-off-by: Lu Hongfei <luhongfei@vivo.com>
>>> Signed-off-by: Yangtao Li <frank.li@vivo.com>
>>> ---
>>> fs/f2fs/file.c | 5 +----
>>> 1 file changed, 1 insertion(+), 4 deletions(-)
>>>
>>> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
>>> index 23c68ee946e5..4faf2c04e325 100644
>>> --- a/fs/f2fs/file.c
>>> +++ b/fs/f2fs/file.c
>>> @@ -546,7 +546,7 @@ static int f2fs_file_open(struct inode *inode, struct file *filp)
>>> if (err)
>>> return err;
>>> - filp->f_mode |= FMODE_NOWAIT | FMODE_BUF_RASYNC;
>>> + filp->f_mode |= FMODE_NOWAIT | FMODE_BUF_RASYNC | FMODE_BUF_WASYNC;
>>> return dquot_file_open(inode, filp);
>>> }
>>> @@ -4515,9 +4515,6 @@ static ssize_t f2fs_buffered_write_iter(struct kiocb *iocb,
>>> struct inode *inode = file_inode(file);
>>> ssize_t ret;
>>> - if (iocb->ki_flags & IOCB_NOWAIT)
>>> - return -EOPNOTSUPP;
>>> -
>>> current->backing_dev_info = inode_to_bdi(inode);
>>> ret = generic_perform_write(iocb, from);
>>> current->backing_dev_info = NULL;
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-06-08 9:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-31 14:40 [PATCH] f2fs: enable nowait async buffered writes Yangtao Li
2023-06-06 6:43 ` Chao Yu
2023-06-06 11:13 ` Yangtao Li
2023-06-08 9:38 ` Chao Yu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®