Re: [Cluster-devel] always fall back to buffered I/O after invalidation failures, was: Re: [PATCH 2/6] iomap: IOMAP_DIO_RWF_NO_STALE_PAGECACHE return if page invalidation fails

2020-07-14 Thread Avi Kivity
On 09/07/2020 05.25, Dave Chinner wrote: Nobody's proposing changing Direct I/O to exclusively work through the pagecache. The proposal is to behave less weirdly when there's already data in the pagecache. No, the proposal it to make direct IO behave *less deterministically* if there is

Re: [Cluster-devel] always fall back to buffered I/O after invalidation failures, was: Re: [PATCH 2/6] iomap: IOMAP_DIO_RWF_NO_STALE_PAGECACHE return if page invalidation fails

2020-07-10 Thread Christoph Hellwig
This looks sane - slightly updated version below to not bother with the ret and a few tidyups. That being said and to get back to the discussion in this thread: I think it would be saner to give up on direct I/O in case of the invalidation failure. I've cooked up a patch on top of this one (for

Re: [Cluster-devel] always fall back to buffered I/O after invalidation failures, was: Re: [PATCH 2/6] iomap: IOMAP_DIO_RWF_NO_STALE_PAGECACHE return if page invalidation fails

2020-07-09 Thread Dave Chinner
On Thu, Jul 09, 2020 at 10:10:38AM -0700, Darrick J. Wong wrote: > On Thu, Jul 09, 2020 at 06:05:19PM +0100, Matthew Wilcox wrote: > > On Thu, Jul 09, 2020 at 09:09:26AM -0700, Darrick J. Wong wrote: > > > On Thu, Jul 09, 2020 at 12:25:27PM +1000, Dave Chinner wrote: > > > > -*/ > > > > -

Re: [Cluster-devel] always fall back to buffered I/O after invalidation failures, was: Re: [PATCH 2/6] iomap: IOMAP_DIO_RWF_NO_STALE_PAGECACHE return if page invalidation fails

2020-07-09 Thread Darrick J. Wong
On Thu, Jul 09, 2020 at 06:05:19PM +0100, Matthew Wilcox wrote: > On Thu, Jul 09, 2020 at 09:09:26AM -0700, Darrick J. Wong wrote: > > On Thu, Jul 09, 2020 at 12:25:27PM +1000, Dave Chinner wrote: > > > iomap: Only invalidate page cache pages on direct IO writes > > > > > > From: Dave Chinner >

Re: [Cluster-devel] always fall back to buffered I/O after invalidation failures, was: Re: [PATCH 2/6] iomap: IOMAP_DIO_RWF_NO_STALE_PAGECACHE return if page invalidation fails

2020-07-09 Thread Matthew Wilcox
On Thu, Jul 09, 2020 at 09:09:26AM -0700, Darrick J. Wong wrote: > On Thu, Jul 09, 2020 at 12:25:27PM +1000, Dave Chinner wrote: > > iomap: Only invalidate page cache pages on direct IO writes > > > > From: Dave Chinner > > > > The historic requirement for XFS to invalidate cached pages on > >

Re: [Cluster-devel] always fall back to buffered I/O after invalidation failures, was: Re: [PATCH 2/6] iomap: IOMAP_DIO_RWF_NO_STALE_PAGECACHE return if page invalidation fails

2020-07-09 Thread Darrick J. Wong
On Thu, Jul 09, 2020 at 12:25:27PM +1000, Dave Chinner wrote: > On Wed, Jul 08, 2020 at 02:54:37PM +0100, Matthew Wilcox wrote: > > On Wed, Jul 08, 2020 at 04:51:27PM +1000, Dave Chinner wrote: > > > On Tue, Jul 07, 2020 at 03:00:30PM +0200, Christoph Hellwig wrote: > > > > On Tue, Jul 07, 2020 at

Re: [Cluster-devel] always fall back to buffered I/O after invalidation failures, was: Re: [PATCH 2/6] iomap: IOMAP_DIO_RWF_NO_STALE_PAGECACHE return if page invalidation fails

2020-07-09 Thread Steven Whitehouse
Hi, On 08/07/2020 17:54, Christoph Hellwig wrote: On Wed, Jul 08, 2020 at 02:54:37PM +0100, Matthew Wilcox wrote: Direct I/O isn't deterministic though. If the file isn't shared, then it works great, but as soon as you get mixed buffered and direct I/O, everything is already terrible. Direct

Re: [Cluster-devel] always fall back to buffered I/O after invalidation failures, was: Re: [PATCH 2/6] iomap: IOMAP_DIO_RWF_NO_STALE_PAGECACHE return if page invalidation fails

2020-07-08 Thread Dave Chinner
On Wed, Jul 08, 2020 at 02:54:37PM +0100, Matthew Wilcox wrote: > On Wed, Jul 08, 2020 at 04:51:27PM +1000, Dave Chinner wrote: > > On Tue, Jul 07, 2020 at 03:00:30PM +0200, Christoph Hellwig wrote: > > > On Tue, Jul 07, 2020 at 01:57:05PM +0100, Matthew Wilcox wrote: > > > > Indeed, I'm in favour

Re: [Cluster-devel] always fall back to buffered I/O after invalidation failures, was: Re: [PATCH 2/6] iomap: IOMAP_DIO_RWF_NO_STALE_PAGECACHE return if page invalidation fails

2020-07-08 Thread Matthew Wilcox
On Wed, Jul 08, 2020 at 06:54:12PM +0200, Christoph Hellwig wrote: > On Wed, Jul 08, 2020 at 02:54:37PM +0100, Matthew Wilcox wrote: > > Direct I/O isn't deterministic though. If the file isn't shared, then > > it works great, but as soon as you get mixed buffered and direct I/O, > > everything

Re: [Cluster-devel] always fall back to buffered I/O after invalidation failures, was: Re: [PATCH 2/6] iomap: IOMAP_DIO_RWF_NO_STALE_PAGECACHE return if page invalidation fails

2020-07-08 Thread Christoph Hellwig
On Wed, Jul 08, 2020 at 02:54:37PM +0100, Matthew Wilcox wrote: > Direct I/O isn't deterministic though. If the file isn't shared, then > it works great, but as soon as you get mixed buffered and direct I/O, > everything is already terrible. Direct I/Os perform pagecache lookups > already, but

Re: [Cluster-devel] always fall back to buffered I/O after invalidation failures, was: Re: [PATCH 2/6] iomap: IOMAP_DIO_RWF_NO_STALE_PAGECACHE return if page invalidation fails

2020-07-08 Thread Dave Chinner
On Tue, Jul 07, 2020 at 03:00:30PM +0200, Christoph Hellwig wrote: > On Tue, Jul 07, 2020 at 01:57:05PM +0100, Matthew Wilcox wrote: > > On Tue, Jul 07, 2020 at 07:43:46AM -0500, Goldwyn Rodrigues wrote: > > > On 9:53 01/07, Christoph Hellwig wrote: > > > > On Mon, Jun 29, 2020 at 02:23:49PM

Re: [Cluster-devel] always fall back to buffered I/O after invalidation failures, was: Re: [PATCH 2/6] iomap: IOMAP_DIO_RWF_NO_STALE_PAGECACHE return if page invalidation fails

2020-07-07 Thread Darrick J. Wong
On Tue, Jul 07, 2020 at 08:49:52AM -0500, Goldwyn Rodrigues wrote: > On 13:57 07/07, Matthew Wilcox wrote: > > On Tue, Jul 07, 2020 at 07:43:46AM -0500, Goldwyn Rodrigues wrote: > > > On 9:53 01/07, Christoph Hellwig wrote: > > > > On Mon, Jun 29, 2020 at 02:23:49PM -0500, Goldwyn Rodrigues

Re: [Cluster-devel] always fall back to buffered I/O after invalidation failures, was: Re: [PATCH 2/6] iomap: IOMAP_DIO_RWF_NO_STALE_PAGECACHE return if page invalidation fails

2020-07-07 Thread Goldwyn Rodrigues
On 7:01 07/07, Darrick J. Wong wrote: > On Tue, Jul 07, 2020 at 08:49:52AM -0500, Goldwyn Rodrigues wrote: > > On 13:57 07/07, Matthew Wilcox wrote: > > > On Tue, Jul 07, 2020 at 07:43:46AM -0500, Goldwyn Rodrigues wrote: > > > > On 9:53 01/07, Christoph Hellwig wrote: > > > > > On Mon, Jun 29,

Re: [Cluster-devel] always fall back to buffered I/O after invalidation failures, was: Re: [PATCH 2/6] iomap: IOMAP_DIO_RWF_NO_STALE_PAGECACHE return if page invalidation fails

2020-07-07 Thread Goldwyn Rodrigues
On 13:57 07/07, Matthew Wilcox wrote: > On Tue, Jul 07, 2020 at 07:43:46AM -0500, Goldwyn Rodrigues wrote: > > On 9:53 01/07, Christoph Hellwig wrote: > > > On Mon, Jun 29, 2020 at 02:23:49PM -0500, Goldwyn Rodrigues wrote: > > > > From: Goldwyn Rodrigues > > > > > > > > For direct I/O, add the

Re: [Cluster-devel] always fall back to buffered I/O after invalidation failures, was: Re: [PATCH 2/6] iomap: IOMAP_DIO_RWF_NO_STALE_PAGECACHE return if page invalidation fails

2020-07-07 Thread Matthew Wilcox
On Tue, Jul 07, 2020 at 07:43:46AM -0500, Goldwyn Rodrigues wrote: > On 9:53 01/07, Christoph Hellwig wrote: > > On Mon, Jun 29, 2020 at 02:23:49PM -0500, Goldwyn Rodrigues wrote: > > > From: Goldwyn Rodrigues > > > > > > For direct I/O, add the flag IOMAP_DIO_RWF_NO_STALE_PAGECACHE to indicate

Re: [Cluster-devel] always fall back to buffered I/O after invalidation failures, was: Re: [PATCH 2/6] iomap: IOMAP_DIO_RWF_NO_STALE_PAGECACHE return if page invalidation fails

2020-07-07 Thread Goldwyn Rodrigues
On 9:53 01/07, Christoph Hellwig wrote: > On Mon, Jun 29, 2020 at 02:23:49PM -0500, Goldwyn Rodrigues wrote: > > From: Goldwyn Rodrigues > > > > For direct I/O, add the flag IOMAP_DIO_RWF_NO_STALE_PAGECACHE to indicate > > that if the page invalidation fails, return back control to the > >

Re: [Cluster-devel] always fall back to buffered I/O after invalidation failures, was: Re: [PATCH 2/6] iomap: IOMAP_DIO_RWF_NO_STALE_PAGECACHE return if page invalidation fails

2020-07-07 Thread Christoph Hellwig
On Tue, Jul 07, 2020 at 01:57:05PM +0100, Matthew Wilcox wrote: > On Tue, Jul 07, 2020 at 07:43:46AM -0500, Goldwyn Rodrigues wrote: > > On 9:53 01/07, Christoph Hellwig wrote: > > > On Mon, Jun 29, 2020 at 02:23:49PM -0500, Goldwyn Rodrigues wrote: > > > > From: Goldwyn Rodrigues > > > > > > >

[Cluster-devel] always fall back to buffered I/O after invalidation failures, was: Re: [PATCH 2/6] iomap: IOMAP_DIO_RWF_NO_STALE_PAGECACHE return if page invalidation fails

2020-07-01 Thread Christoph Hellwig
On Mon, Jun 29, 2020 at 02:23:49PM -0500, Goldwyn Rodrigues wrote: > From: Goldwyn Rodrigues > > For direct I/O, add the flag IOMAP_DIO_RWF_NO_STALE_PAGECACHE to indicate > that if the page invalidation fails, return back control to the > filesystem so it may fallback to buffered mode. > >