[PATCH -next] bcachefs: support iopoll method

Li Zetao posted 1 patch 1 year, 5 months ago
fs/bcachefs/fs.c | 1 +
1 file changed, 1 insertion(+)
[PATCH -next] bcachefs: support iopoll method
Posted by Li Zetao 1 year, 5 months ago
When bcachefs uses io_uring, implement the iopoll method to support
IORING_SETUP_IOPOLL.

Signed-off-by: Li Zetao <lizetao1@huawei.com>
---
 fs/bcachefs/fs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/bcachefs/fs.c b/fs/bcachefs/fs.c
index c50457ba808d..c97bc94fcb83 100644
--- a/fs/bcachefs/fs.c
+++ b/fs/bcachefs/fs.c
@@ -1213,6 +1213,7 @@ static const struct file_operations bch_file_operations = {
 	.llseek		= bch2_llseek,
 	.read_iter	= bch2_read_iter,
 	.write_iter	= bch2_write_iter,
+	.iopoll		= iocb_bio_iopoll,
 	.mmap		= bch2_mmap,
 	.get_unmapped_area = thp_get_unmapped_area,
 	.fsync		= bch2_fsync,
-- 
2.34.1
Re: [PATCH -next] bcachefs: support iopoll method
Posted by Kent Overstreet 1 year, 5 months ago
On Thu, Aug 15, 2024 at 10:20:34PM GMT, Li Zetao wrote:
> When bcachefs uses io_uring, implement the iopoll method to support
> IORING_SETUP_IOPOLL.
> 
> Signed-off-by: Li Zetao <lizetao1@huawei.com>

tested?
Re: [PATCH -next] bcachefs: support iopoll method
Posted by Li Zetao 1 year, 5 months ago
Hi,

在 2024/8/15 22:16, Kent Overstreet 写道:
> On Thu, Aug 15, 2024 at 10:20:34PM GMT, Li Zetao wrote:
>> When bcachefs uses io_uring, implement the iopoll method to support
>> IORING_SETUP_IOPOLL.
>>
>> Signed-off-by: Li Zetao <lizetao1@huawei.com>
> 
> tested?
I have tested with fio:

[root]# vi bcachefs.fio
[global]
direct=1
thread=1
norandommap=1
group_reporting=1
time_based=1
ioengine=io_uring

rw=randwrite
bs=4096
runtime=20
numjobs=1
fixedbufs=1
hipri=1
registerfiles=1
sqthread_poll=1

[filename0]
size=1G
iodepth=1
cpus_allowed=20
filename=/mnt/bcachefs/test

The option "hipri=1" need to support IORING_SETUP_IOPOLL for io_uring 
engine.