From: Matthew Bobrowski <mbobrowski@mbobrowski.org>
To: "Theodore Y. Ts'o" <tytso@mit.edu>
Cc: jack@suse.cz, adilger.kernel@dilger.ca,
linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org,
riteshh@linux.ibm.com
Subject: Re: [PATCH v7 11/11] ext4: introduce direct I/O write using iomap infrastructure
Date: Wed, 6 Nov 2019 07:57:13 +1100 [thread overview]
Message-ID: <20191105205712.GB1739@bobrowski> (raw)
In-Reply-To: <20191105162855.GK28764@mit.edu>
On Tue, Nov 05, 2019 at 11:28:55AM -0500, Theodore Y. Ts'o wrote:
> On Tue, Nov 05, 2019 at 11:02:39PM +1100, Matthew Bobrowski wrote:
> > + ret = iomap_dio_rw(iocb, from, &ext4_iomap_ops, &ext4_dio_write_ops,
> > + is_sync_kiocb(iocb) || unaligned_aio || extend);
> > +
> > + if (extend)
> > + ret = ext4_handle_inode_extension(inode, offset, ret, count);
> > +
>
> Can we do a slight optimization here like this?
>
> ret = iomap_dio_rw(iocb, from, &ext4_iomap_ops, &ext4_dio_write_ops,
> is_sync_kiocb(iocb) || unaligned_aio || extend);
>
> if (extend && ret != -EBIOCQUEUED)
> ret = ext4_handle_inode_extension(inode, offset, ret, count);
>
>
> If iomap_dio_rw() returns -EBIOCQUEUED, there's no need to do any of
> the ext4_handle_inode_extension --- in particular, there's no need to
> call ext4_truncate_failed_write(), which has a bunch of extra
> overhead, including taking and releasing i_data_sem.
Hm, but for extension, unaligned asynchronous IO, or synchronous IO
cases, 'wait_for_completion' within iomap_dio_rw() is set to true and
as a result we'd never expect to receive -EIOCBQUEUED from
iomap_dio_rw()?
So, with that said, would the above change be necessary seeing as
though we'd never expect ret == -EIOCBQUEUED when extend == true?
Maybe I'm missing something?
/M
next prev parent reply other threads:[~2019-11-05 20:57 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-05 11:58 [PATCH v7 00/11] ext4: port direct I/O to iomap infrastructure Matthew Bobrowski
2019-11-05 11:58 ` [PATCH v7 01/11] ext4: reorder map.m_flags checks within ext4_iomap_begin() Matthew Bobrowski
2019-11-05 11:59 ` [PATCH v7 02/11] ext4: update direct I/O read lock pattern for IOCB_NOWAIT Matthew Bobrowski
2019-11-05 11:59 ` [PATCH v7 03/11] ext4: iomap that extends beyond EOF should be marked dirty Matthew Bobrowski
2019-11-05 11:59 ` [PATCH v7 04/11] ext4: move set iomap routines into a separate helper ext4_set_iomap() Matthew Bobrowski
2019-11-05 12:00 ` [PATCH v7 05/11] ext4: split IOMAP_WRITE branch in ext4_iomap_begin() into helper Matthew Bobrowski
2019-11-05 12:01 ` [PATCH v7 07/11] ext4: introduce direct I/O read using iomap infrastructure Matthew Bobrowski
2019-11-05 12:01 ` [PATCH v7 08/11] ext4: move inode extension/truncate code out from ->iomap_end() callback Matthew Bobrowski
2019-11-05 15:49 ` Darrick J. Wong
2019-11-05 21:10 ` Matthew Bobrowski
2019-11-05 12:02 ` [PATCH v7 09/11] ext4: move inode extension check out from ext4_iomap_alloc() Matthew Bobrowski
2019-11-05 12:02 ` [PATCH v7 10/11] ext4: update ext4_sync_file() to not use __generic_file_fsync() Matthew Bobrowski
2019-11-05 12:02 ` [PATCH v7 11/11] ext4: introduce direct I/O write using iomap infrastructure Matthew Bobrowski
2019-11-05 13:59 ` Jan Kara
2019-11-05 20:32 ` Matthew Bobrowski
2019-11-05 20:53 ` Theodore Y. Ts'o
2019-11-05 21:00 ` Matthew Bobrowski
2019-11-06 0:59 ` Theodore Y. Ts'o
2019-11-05 16:28 ` Theodore Y. Ts'o
2019-11-05 20:57 ` Matthew Bobrowski [this message]
2019-11-05 12:03 ` [PATCH v7 06/11] ext4: introduce new callback for IOMAP_REPORT Matthew Bobrowski
2019-11-05 15:43 ` Darrick J. Wong
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=20191105205712.GB1739@bobrowski \
--to=mbobrowski@mbobrowski.org \
--cc=adilger.kernel@dilger.ca \
--cc=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=riteshh@linux.ibm.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;
as well as URLs for NNTP newsgroup(s).