lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230614083105.20663-1-luhongfei@vivo.com>
Date:   Wed, 14 Jun 2023 16:31:04 +0800
From:   Lu Hongfei <luhongfei@...o.com>
To:     "Theodore Ts'o" <tytso@....edu>,
        Andreas Dilger <adilger.kernel@...ger.ca>,
        linux-ext4@...r.kernel.org (open list:EXT4 FILE SYSTEM),
        linux-kernel@...r.kernel.org (open list)
Cc:     opensource.kernel@...o.com, luhongfei@...o.com,
        Yangtao Li <frank.li@...o.com>
Subject: [PATCH] ext4: enable nowait async buffered writes

This adds the async buffered write support to ext4,
the following is the relevant test data.

    iodepth      | 1    | 2    | 4    | 8    | 16   | 32   |
    before(M/s)  | 842  | 1047 | 1098 | 1167 | 1172 | 1247 |
    after(M/s)   | 1293 | 1674 | 1794 | 1862 | 1897 | 1833 |

The following is the fio configuration:

[global]
ioengine=io_uring
sqthread_poll=1
threads=1
iodepth=16
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@...o.com>
Signed-off-by: Yangtao Li <frank.li@...o.com>
---
 fs/ext4/file.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/fs/ext4/file.c b/fs/ext4/file.c
index 6a16d07965f9..5da7c5612324
--- a/fs/ext4/file.c
+++ b/fs/ext4/file.c
@@ -288,9 +288,6 @@ static ssize_t ext4_buffered_write_iter(struct kiocb *iocb,
 	ssize_t ret;
 	struct inode *inode = file_inode(iocb->ki_filp);
 
-	if (iocb->ki_flags & IOCB_NOWAIT)
-		return -EOPNOTSUPP;
-
 	inode_lock(inode);
 	ret = ext4_write_checks(iocb, from);
 	if (ret <= 0)
@@ -905,7 +902,7 @@ static int ext4_file_open(struct inode *inode, struct file *filp)
 			return ret;
 	}
 
-	filp->f_mode |= FMODE_NOWAIT | FMODE_BUF_RASYNC |
+	filp->f_mode |= FMODE_NOWAIT | FMODE_BUF_RASYNC | FMODE_BUF_WASYNC |
 			FMODE_DIO_PARALLEL_WRITE;
 	return dquot_file_open(inode, filp);
 }
-- 
2.39.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ