[PATCH v2] f2fs: enable nowait async buffered writes

Yangtao Li posted 1 patch 2 years, 7 months ago
fs/f2fs/file.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
[PATCH v2] f2fs: enable nowait async buffered writes
Posted by Yangtao Li 2 years, 7 months ago
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 |

The following is the fio configuration:

[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

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 4dd4e2bd000a..74ecc9e20619 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -554,7 +554,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);
 }
@@ -4523,9 +4523,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
Re: [PATCH v2] f2fs: enable nowait async buffered writes
Posted by Chao Yu 2 years, 7 months ago
On 2023/6/13 15:29, Yangtao Li wrote:
> 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 |
> 
> The following is the fio configuration:
> 
> [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
> 
> Signed-off-by: Lu Hongfei <luhongfei@vivo.com>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>

Jaegeuk, it may be late, feel free to add:

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,
Re: [f2fs-dev] [PATCH v2] f2fs: enable nowait async buffered writes
Posted by patchwork-bot+f2fs@kernel.org 2 years, 7 months ago
Hello:

This patch was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <jaegeuk@kernel.org>:

On Tue, 13 Jun 2023 15:29:11 +0800 you wrote:
> 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 |
> 
> [...]

Here is the summary with links:
  - [f2fs-dev,v2] f2fs: enable nowait async buffered writes
    https://git.kernel.org/jaegeuk/f2fs/c/d61812691182

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html