linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Jens Axboe <axboe@kernel.dk>,
	Goldwyn Rodrigues <rgoldwyn@suse.de>,
	hch@lst.de, jack@suse.cz, akpm@linux-foundation.org,
	linux-block@vger.kernel.org
Subject: Re: [PATCH 0/10 v13] merge request: No wait AIO
Date: Tue, 20 Jun 2017 09:20:10 +0200	[thread overview]
Message-ID: <20170620072010.GA8245@lst.de> (raw)
In-Reply-To: <20170620002428.GM10672@ZenIV.linux.org.uk>

On Tue, Jun 20, 2017 at 01:24:28AM +0100, Al Viro wrote:
> On Mon, Jun 19, 2017 at 05:36:05PM -0600, Jens Axboe wrote:
> > On 06/19/2017 05:34 PM, Al Viro wrote:
> > > On Mon, Jun 19, 2017 at 05:15:16PM -0600, Jens Axboe wrote:
> > >> On 06/19/2017 10:33 AM, Goldwyn Rodrigues wrote:
> > >>> Jens,
> > >>>
> > >>> As Christoph suggested, I am sending the patches against the block
> > >>> tree for merge since the block layer changes had the most conflicts.
> > >>> My tree is at https://github.com/goldwynr/linux/tree/nowait-block
> > >>
> > >> I can merge it for 4.13, but I need Al to be happy with it first.
> > > 
> > > FWIW, it's really a matter of who gets more conflicts - I'm OK with the
> > > general shape of that code and it could go through either tree (or both,
> > > for that matter, if an immutable branch is promised).
> > 
> > I'm still hopeful that the write hint patchset will make it as well,
> > which will definitely conflict with this. So if you don't mind, I'd
> > like to queue it through the block tree. The block for-4.x/ branches
> > are not rebased.
> 
> Fine by me; the only problem I see there at the moment is with ext4 and
> xfs ->read_iter() not buggering off on nowait (xfs one has
>         xfs_ilock(ip, XFS_IOLOCK_SHARED);
> done before it gets to generic_file_read_iter()).

Something like the patch below should take care of the XFS, free feel
to fold.


diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
index e159eb381d9f..c74847f71b3d 100644
--- a/fs/xfs/xfs_file.c
+++ b/fs/xfs/xfs_file.c
@@ -216,7 +216,11 @@ xfs_file_dio_aio_read(
 
 	file_accessed(iocb->ki_filp);
 
-	xfs_ilock(ip, XFS_IOLOCK_SHARED);
+	if (!xfs_ilock_nowait(ip, XFS_IOLOCK_SHARED)) {
+		if (iocb->ki_flags & IOCB_NOWAIT)
+			return -EAGAIN;
+		xfs_ilock(ip, XFS_IOLOCK_SHARED);
+	}
 	ret = iomap_dio_rw(iocb, to, &xfs_iomap_ops, NULL);
 	xfs_iunlock(ip, XFS_IOLOCK_SHARED);
 
@@ -237,7 +241,11 @@ xfs_file_dax_read(
 	if (!count)
 		return 0; /* skip atime */
 
-	xfs_ilock(ip, XFS_IOLOCK_SHARED);
+	if (!xfs_ilock_nowait(ip, XFS_IOLOCK_SHARED)) {
+		if (iocb->ki_flags & IOCB_NOWAIT)
+			return -EAGAIN;
+		xfs_ilock(ip, XFS_IOLOCK_SHARED);
+	}
 	ret = dax_iomap_rw(iocb, to, &xfs_iomap_ops);
 	xfs_iunlock(ip, XFS_IOLOCK_SHARED);
 

  reply	other threads:[~2017-06-20  7:20 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-19 16:33 [PATCH 0/10 v13] merge request: No wait AIO Goldwyn Rodrigues
2017-06-19 16:33 ` [PATCH 01/10] fs: Separate out kiocb flags setup based on RWF_* flags Goldwyn Rodrigues
2017-06-19 16:33 ` [PATCH 02/10] fs: Introduce filemap_range_has_page() Goldwyn Rodrigues
2017-06-19 16:33 ` [PATCH 03/10] fs: Use RWF_* flags for AIO operations Goldwyn Rodrigues
2017-06-19 16:33 ` [PATCH 04/10] fs: Introduce RWF_NOWAIT and FMODE_AIO_NOWAIT Goldwyn Rodrigues
2017-06-19 16:33 ` [PATCH 05/10] fs: return if direct I/O will trigger writeback Goldwyn Rodrigues
2017-06-19 16:44   ` Al Viro
2017-06-19 16:33 ` [PATCH 06/10] fs: Introduce IOMAP_NOWAIT Goldwyn Rodrigues
2017-06-19 16:33 ` [PATCH 07/10] block: return on congested block device Goldwyn Rodrigues
2017-06-19 16:33 ` [PATCH 08/10] ext4: nowait aio support Goldwyn Rodrigues
2017-06-19 16:33 ` [PATCH 09/10] xfs: " Goldwyn Rodrigues
2017-06-19 16:33 ` [PATCH 10/10] btrfs: " Goldwyn Rodrigues
2017-06-19 23:15 ` [PATCH 0/10 v13] merge request: No wait AIO Jens Axboe
2017-06-19 23:20   ` Goldwyn Rodrigues
2017-06-19 23:34   ` Al Viro
2017-06-19 23:36     ` Jens Axboe
2017-06-20  0:24       ` Al Viro
2017-06-20  7:20         ` Christoph Hellwig [this message]
2017-06-20 11:53           ` Goldwyn Rodrigues

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=20170620072010.GA8245@lst.de \
    --to=hch@lst.de \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=jack@suse.cz \
    --cc=linux-block@vger.kernel.org \
    --cc=rgoldwyn@suse.de \
    --cc=viro@ZenIV.linux.org.uk \
    /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).