Skip to contentSkip to conversation

f2fs: flag as supporting buffered async reads

PATCH Applied Yangtao Li 5 participants 5 messages May 31, 2023 – Jun 7, 2023 F2FS file system

lore
Share & tools
lore

Yangtao Li

author
#0 lore raw

PATCH 1/1 f2fs: flag as supporting buffered async reads

After enabling this feature, the read performance has been greatly improved:

    167M/s -> 234M/s, Increase ratio by 40%

Test w/:

    ./fio --name=onessd --filename=/data/test/local/io_uring_test
    --size=256M --rw=randread --bs=4k --direct=0 --overwrite=0
    --numjobs=1 --iodepth=1 --time_based=0 --runtime=10
    --ioengine=io_uring --registerfiles --fixedbufs
    --gtod_reduce=1 --group_reporting --sqthread_poll=1
---
 fs/f2fs/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/file.c +1 -1
index 015ed274dc31..23c68ee946e5 100644
@@ -546,7 +546,7 @@ static int f2fs_file_open(struct inode *inode, struct file *filp)
 	if (err)
 		return err;
 
-	filp->f_mode |= FMODE_NOWAIT;
+	filp->f_mode |= FMODE_NOWAIT | FMODE_BUF_RASYNC;
 
 	return dquot_file_open(inode, filp);
 }
Signature · 8 lines
2.39.0



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

Hi Yangtao,

I remember hearing that f2fs can perform relatively poorly under io_uring, nice find.

I suggest rewriting the commit message though. From the looks of it, it might suggest that FMODE_BUF_RASYNC is a magic flag that automatically improves performance that can be enabled willy nilly.

How about something like:

f2fs uses generic_file_buffered_read(), which supports buffered async reads since commit 1a0a7853b901 ("mm: support async buffered reads in generic_file_buffered_read()").

Match other file-systems and enable it. The read performance has been greatly improved under io_uring:

    167M/s -> 234M/s, Increase ratio by 40%

Test w/:

    ./fio --name=onessd --filename=/data/test/local/io_uring_test
    --size=256M --rw=randread --bs=4k --direct=0 --overwrite=0
    --numjobs=1 --iodepth=1 --time_based=0 --runtime=10
    --ioengine=io_uring --registerfiles --fixedbufs
    --gtod_reduce=1 --group_reporting --sqthread_poll=1
Quoted 37 lines · On Wed, May 31, 2023 at 10:01 PM Yangtao Li via Linux-f2fs-devel…

After enabling this feature, the read performance has been greatly improved:

    167M/s -> 234M/s, Increase ratio by 40%

Test w/:

    ./fio --name=onessd --filename=/data/test/local/io_uring_test
    --size=256M --rw=randread --bs=4k --direct=0 --overwrite=0
    --numjobs=1 --iodepth=1 --time_based=0 --runtime=10
    --ioengine=io_uring --registerfiles --fixedbufs
    --gtod_reduce=1 --group_reporting --sqthread_poll=1
---
 fs/f2fs/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/file.c +1 -2
index 015ed274dc31..23c68ee946e5 100644
@@ -546,7 +546,7 @@ static int f2fs_file_open(struct inode *inode, struct file *filp)
        if (err)
                return err;
 
-       filp->f_mode |= FMODE_NOWAIT;
+       filp->f_mode |= FMODE_NOWAIT | FMODE_BUF_RASYNC;
 
        return dquot_file_open(inode, filp);
 }
--

2.39.0

Quoted 4 lines

_______________________________________________
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

maintainer
#2 lore raw
Quoted 9 lines · Juhyung Park

Hi Yangtao,

I remember hearing that f2fs can perform relatively poorly under io_uring, nice find.

I suggest rewriting the commit message though. From the looks of it, it might suggest that FMODE_BUF_RASYNC is a magic flag that automatically improves performance that can be enabled willy nilly.

Quoted 5 lines

How about something like:

f2fs uses generic_file_buffered_read(), which supports buffered async reads since commit 1a0a7853b901 ("mm: support async buffered reads in generic_file_buffered_read()").

Thanks Juhyung,

Applied with a minor motification based on yours. :)

Quoted 52 lines

Match other file-systems and enable it. The read performance has been greatly improved under io_uring:

    167M/s -> 234M/s, Increase ratio by 40%

Test w/:

    ./fio --name=onessd --filename=/data/test/local/io_uring_test
    --size=256M --rw=randread --bs=4k --direct=0 --overwrite=0
    --numjobs=1 --iodepth=1 --time_based=0 --runtime=10
    --ioengine=io_uring --registerfiles --fixedbufs
    --gtod_reduce=1 --group_reporting --sqthread_poll=1
Quoted 37 lines · On Wed, May 31, 2023 at 10:01 PM Yangtao Li via Linux-f2fs-devel…

After enabling this feature, the read performance has been greatly improved:

    167M/s -> 234M/s, Increase ratio by 40%

Test w/:

    ./fio --name=onessd --filename=/data/test/local/io_uring_test
    --size=256M --rw=randread --bs=4k --direct=0 --overwrite=0
    --numjobs=1 --iodepth=1 --time_based=0 --runtime=10
    --ioengine=io_uring --registerfiles --fixedbufs
    --gtod_reduce=1 --group_reporting --sqthread_poll=1
---
 fs/f2fs/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/file.c +1 -2
index 015ed274dc31..23c68ee946e5 100644
@@ -546,7 +546,7 @@ static int f2fs_file_open(struct inode *inode, struct file *filp)
        if (err)
                return err;
 
-       filp->f_mode |= FMODE_NOWAIT;
+       filp->f_mode |= FMODE_NOWAIT | FMODE_BUF_RASYNC;
 
        return dquot_file_open(inode, filp);
 }
--

2.39.0

Quoted 4 lines
Quoted 4 lines

_______________________________________________
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

maintainer Reviewed-by
#3 lore raw
Quoted 12 lines · Jaegeuk Kim
Quoted 11 lines · Juhyung Park

Hi Yangtao,

I remember hearing that f2fs can perform relatively poorly under io_uring, nice find.

I suggest rewriting the commit message though. From the looks of it, it might suggest that FMODE_BUF_RASYNC is a magic flag that automatically improves performance that can be enabled willy nilly.

How about something like:

Quoted 7 lines
Quoted 3 lines

f2fs uses generic_file_buffered_read(), which supports buffered async reads since commit 1a0a7853b901 ("mm: support async buffered reads in generic_file_buffered_read()").

Thanks Juhyung,

Applied with a minor motification based on yours. :)

The version in dev-test branch looks good to me.

Thanks,

Quoted 57 lines
Quoted 57 lines

Match other file-systems and enable it. The read performance has been greatly improved under io_uring:

     167M/s -> 234M/s, Increase ratio by 40%

Test w/:

     ./fio --name=onessd --filename=/data/test/local/io_uring_test
     --size=256M --rw=randread --bs=4k --direct=0 --overwrite=0
     --numjobs=1 --iodepth=1 --time_based=0 --runtime=10
     --ioengine=io_uring --registerfiles --fixedbufs
     --gtod_reduce=1 --group_reporting --sqthread_poll=1
Quoted 41 lines · On Wed, May 31, 2023 at 10:01 PM Yangtao Li via Linux-f2fs-devel…

After enabling this feature, the read performance has been greatly improved:

     167M/s -> 234M/s, Increase ratio by 40%

Test w/:

     ./fio --name=onessd --filename=/data/test/local/io_uring_test
     --size=256M --rw=randread --bs=4k --direct=0 --overwrite=0
     --numjobs=1 --iodepth=1 --time_based=0 --runtime=10
     --ioengine=io_uring --registerfiles --fixedbufs
     --gtod_reduce=1 --group_reporting --sqthread_poll=1
---
  fs/f2fs/file.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/file.c +1 -2
index 015ed274dc31..23c68ee946e5 100644
@@ -546,7 +546,7 @@ static int f2fs_file_open(struct inode *inode, struct file *filp)
         if (err)
                 return err;
 
-       filp->f_mode |= FMODE_NOWAIT;
+       filp->f_mode |= FMODE_NOWAIT | FMODE_BUF_RASYNC;
 
         return dquot_file_open(inode, filp);
  }
--

2.39.0

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

#4 lore raw
In reply to Yangtao Li
This patch was applied to jaegeuk/f2fs.git (dev) by Jaegeuk Kim <[email protected]>:

Hello:

This patch was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <[email protected]>:

Quoted 5 lines · On Wed, 31 May 2023 20:59:18 +0800 you wrote:

After enabling this feature, the read performance has been greatly improved:

    167M/s -> 234M/s, Increase ratio by 40%
Quoted 8 lines

Test w/:

    ./fio --name=onessd --filename=/data/test/local/io_uring_test
    --size=256M --rw=randread --bs=4k --direct=0 --overwrite=0
    --numjobs=1 --iodepth=1 --time_based=0 --runtime=10
    --ioengine=io_uring --registerfiles --fixedbufs
    --gtod_reduce=1 --group_reporting --sqthread_poll=1

[...]

Here is the summary with links:
- [f2fs-dev] f2fs: flag as supporting buffered async reads

    https://git.kernel.org/jaegeuk/f2fs/c/fdb43e12e0c1

You are awesome, thank you!

Signature · 10 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html




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