public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Lu Hongfei <luhongfei@vivo.com>
Cc: Theodore Ts'o <tytso@mit.edu>,
	Andreas Dilger <adilger.kernel@dilger.ca>,
	"open list:EXT4 FILE SYSTEM" <linux-ext4@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>,
	opensource.kernel@vivo.com, Yangtao Li <frank.li@vivo.com>
Subject: Re: [PATCH] ext4: enable nowait async buffered writes
Date: Fri, 16 Jun 2023 09:07:32 +1000	[thread overview]
Message-ID: <ZIuZtP7uxRKAOMmB@dread.disaster.area> (raw)
In-Reply-To: <20230614083105.20663-1-luhongfei@vivo.com>

On Wed, Jun 14, 2023 at 04:31:04PM +0800, Lu Hongfei wrote:
> 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@vivo.com>
> Signed-off-by: Yangtao Li <frank.li@vivo.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);

Ah, no, that's not how we enable IOCB_NOWAIT functionality. Just
because removing the check makes it go a little bit faster, it
doesn't mean that it is actually doing the right thing.

i.e. before remove IOCB_NOWAIT checks like this, we actually have to
make the functionality operate in a non-blocking manner when
IOCB_NOWAIT is set.  Clearly, this patch does not do that, because
the very first thing that occurs after the removed NOWAIT check is a
blocking inode_lock() call....

Please go and look at the series that added NOWAIT buffered write
support to XFS for io_uring an example of sorts of changes that need
to be made to ext4 to support IOCB_NOWAIT buffered writes.

https://lore.kernel.org/linux-xfs/20220608171741.3875418-1-shr@fb.com/

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

      reply	other threads:[~2023-06-15 23:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-14  8:31 [PATCH] ext4: enable nowait async buffered writes Lu Hongfei
2023-06-15 23:07 ` Dave Chinner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZIuZtP7uxRKAOMmB@dread.disaster.area \
    --to=david@fromorbit.com \
    --cc=adilger.kernel@dilger.ca \
    --cc=frank.li@vivo.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luhongfei@vivo.com \
    --cc=opensource.kernel@vivo.com \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox