From: Dave Chinner <david@fromorbit.com>
To: Jeremy Bongio <bongiojp@gmail.com>
Cc: Ted Tso <tytso@mit.edu>, "Darrick J . Wong" <djwong@kernel.org>,
Allison Henderson <allison.henderson@oracle.com>,
linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-xfs@vger.kernel.org
Subject: Re: [PATCH 1/1] For DIO writes with no mapped pages for inode, skip deferring completion.
Date: Thu, 22 Jun 2023 10:04:46 +1000 [thread overview]
Message-ID: <ZJOQHpKjghoGWYZ4@dread.disaster.area> (raw)
In-Reply-To: <20230621174114.1320834-2-bongiojp@gmail.com>
On Wed, Jun 21, 2023 at 10:29:20AM -0700, Jeremy Bongio wrote:
> If there are no mapped pages for an DIO write then the page cache does not
> need to be updated. For very fast SSDs and direct async IO, deferring work
> completion can result in a significant performance loss.
> ---
> fs/iomap/direct-io.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/fs/iomap/direct-io.c b/fs/iomap/direct-io.c
> index 019cc87d0fb3..8f27d0dc4f6d 100644
> --- a/fs/iomap/direct-io.c
> +++ b/fs/iomap/direct-io.c
> @@ -168,7 +168,9 @@ void iomap_dio_bio_end_io(struct bio *bio)
> struct task_struct *waiter = dio->submit.waiter;
> WRITE_ONCE(dio->submit.waiter, NULL);
> blk_wake_io_task(waiter);
> - } else if (dio->flags & IOMAP_DIO_WRITE) {
> + } else if (dio->flags & IOMAP_DIO_WRITE &&
> + (!dio->iocb->ki_filp->f_inode ||
> + dio->iocb->ki_filp->f_inode->i_mapping->nrpages))) {
> struct inode *inode = file_inode(dio->iocb->ki_filp);
Writes that are need O_DSYNC, unwritten extent conversion, file size
extension, etc all need to be deferred. This will break all of them,
as well as any other type of write that the filesystem itself needs
to run completion in task context.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2023-06-22 0:06 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-21 17:29 [PATCH 0/1] iomap regression for aio dio 4k writes Jeremy Bongio
2023-06-21 17:29 ` [PATCH 1/1] For DIO writes with no mapped pages for inode, skip deferring completion Jeremy Bongio
2023-06-21 18:55 ` Matthew Wilcox
2023-06-22 0:04 ` Dave Chinner [this message]
2023-06-21 23:59 ` [PATCH 0/1] iomap regression for aio dio 4k writes Dave Chinner
2023-06-22 1:55 ` Dave Chinner
2023-06-22 2:55 ` Matthew Wilcox
2023-06-22 4:08 ` Christoph Hellwig
2023-06-22 4:47 ` Dave Chinner
2023-06-23 2:32 ` Theodore Ts'o
2023-06-23 3:02 ` Dave Chinner
2023-06-22 23:22 ` Allison Henderson
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=ZJOQHpKjghoGWYZ4@dread.disaster.area \
--to=david@fromorbit.com \
--cc=allison.henderson@oracle.com \
--cc=bongiojp@gmail.com \
--cc=djwong@kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--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