linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Brian Foster <bfoster@redhat.com>
Cc: Dave Chinner <david@fromorbit.com>,
	Christoph Hellwig <hch@lst.de>,
	linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	avi@scylladb.com
Subject: Re: [PATCH 09/10] iomap: add a IOMAP_DIO_NOALLOC flag
Date: Thu, 14 Jan 2021 18:29:18 +0100	[thread overview]
Message-ID: <20210114172918.GB30826@lst.de> (raw)
In-Reply-To: <20210113153215.GA1284163@bfoster>

On Wed, Jan 13, 2021 at 10:32:15AM -0500, Brian Foster wrote:
> Something I hadn't thought about before is whether applications might
> depend on current unaligned dio serialization for coherency and thus
> break if the kernel suddenly allows concurrent unaligned dio to pass
> through. Should this be something that is explicitly requested by
> userspace?

direct I/O has always been documented as not being synchronized.  Also
for block devices you won't get any synchronization at all, down to
the sector level.

> 
> That aside, I agree that the DIO_UNALIGNED approach seems a bit more
> clear than NOALLOC, but TBH the more I look at this the more Christoph's
> first approach seems cleanest to me. It is a bit unfortunate to
> duplicate the mapping lookups and have the extra ILOCK cycle, but the
> lock is shared and only taken when I/O is unaligned. I don't really see
> why that is a show stopper yet it's acceptable to fall back to exclusive
> dio if the target range happens to be discontiguous (but otherwise
> mapped/written).

I think both approaches have pros an cons.  My original one (which really
is yours as you suggested it) has the advantage of having a much simpler
structure, and not limititing the non-exclusive I/O to a single extent.
The refined version of Dave's approach avoids the extra one or two extent
lookups, and any knowledge of extent state above the iomap layer.

  parent reply	other threads:[~2021-01-14 17:30 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-12 16:26 [RFC] another attempt to reduce sub-block DIO serialisation Christoph Hellwig
2021-01-12 16:26 ` [PATCH 01/10] xfs: factor out a xfs_ilock_iocb helper Christoph Hellwig
2021-01-12 22:41   ` Dave Chinner
2021-01-12 16:26 ` [PATCH 02/10] xfs: make xfs_file_aio_write_checks IOCB_NOWAIT-aware Christoph Hellwig
2021-01-12 22:42   ` Dave Chinner
2021-01-12 16:26 ` [PATCH 03/10] xfs: cleanup the read/write helper naming Christoph Hellwig
2021-01-12 22:43   ` Dave Chinner
2021-01-12 16:26 ` [PATCH 04/10] xfs: remove the buffered I/O fallback assert Christoph Hellwig
2021-01-12 22:44   ` Dave Chinner
2021-01-12 16:26 ` [PATCH 05/10] xfs: simplify the read/write tracepoints Christoph Hellwig
2021-01-12 22:54   ` Dave Chinner
2021-01-12 16:26 ` [PATCH 06/10] xfs: improve the reflink_bounce_dio_write tracepoint Christoph Hellwig
2021-01-12 22:56   ` Dave Chinner
2021-01-12 16:26 ` [PATCH 07/10] xfs: split unaligned DIO write code out Christoph Hellwig
2021-01-12 23:00   ` Dave Chinner
2021-01-12 16:26 ` [PATCH 08/10] iomap: pass a flags argument to iomap_dio_rw Christoph Hellwig
2021-01-12 16:26 ` [PATCH 09/10] iomap: add a IOMAP_DIO_NOALLOC flag Christoph Hellwig
2021-01-12 23:29   ` Dave Chinner
2021-01-13 15:32     ` Brian Foster
2021-01-13 22:49       ` Dave Chinner
2021-01-14 10:23         ` Brian Foster
2021-01-14 10:43           ` Avi Kivity
2021-01-14 17:29       ` Christoph Hellwig [this message]
2021-01-14 17:26     ` Christoph Hellwig
2021-01-12 16:26 ` [PATCH 10/10] xfs: reduce exclusive locking on unaligned dio Christoph Hellwig

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=20210114172918.GB30826@lst.de \
    --to=hch@lst.de \
    --cc=avi@scylladb.com \
    --cc=bfoster@redhat.com \
    --cc=david@fromorbit.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    /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).