Re: [PATCH v2] iomap: report collisions between directio and buffered writes to userspace

2017-11-21 Thread Darrick J. Wong
On Wed, Nov 22, 2017 at 09:28:06AM +1100, Dave Chinner wrote: > On Tue, Nov 21, 2017 at 04:52:53AM -0800, Matthew Wilcox wrote: > > On Tue, Nov 21, 2017 at 05:48:15PM +1100, Dave Chinner wrote: > > > On Mon, Nov 20, 2017 at 08:32:40PM -0800, Matthew Wilcox wrote: > > > > On Mon, Nov 20, 2017 at

Re: [PATCH v2] iomap: report collisions between directio and buffered writes to userspace

2017-11-21 Thread Dave Chinner
On Tue, Nov 21, 2017 at 04:52:53AM -0800, Matthew Wilcox wrote: > On Tue, Nov 21, 2017 at 05:48:15PM +1100, Dave Chinner wrote: > > On Mon, Nov 20, 2017 at 08:32:40PM -0800, Matthew Wilcox wrote: > > > On Mon, Nov 20, 2017 at 05:37:53PM -0800, Darrick J. Wong wrote: > > > > On Tue, Nov 21, 2017 at

Re: [PATCH v2] iomap: report collisions between directio and buffered writes to userspace

2017-11-21 Thread Darrick J. Wong
On Tue, Nov 21, 2017 at 09:23:47AM -0800, Matthew Wilcox wrote: > On Tue, Nov 21, 2017 at 09:27:49AM +1100, Dave Chinner wrote: > > On Mon, Nov 20, 2017 at 01:51:00PM -0800, Matthew Wilcox wrote: > > > If you want an example of it in use, I'm pretty happy with this patch > > > that switches the

Re: [PATCH v2] iomap: report collisions between directio and buffered writes to userspace

2017-11-21 Thread Matthew Wilcox
On Tue, Nov 21, 2017 at 09:27:49AM +1100, Dave Chinner wrote: > On Mon, Nov 20, 2017 at 01:51:00PM -0800, Matthew Wilcox wrote: > > If you want an example of it in use, I'm pretty happy with this patch > > that switches the brd driver entirely from the radix tree API to the > > xarray API: > > >

Re: [PATCH v2] iomap: report collisions between directio and buffered writes to userspace

2017-11-21 Thread Matthew Wilcox
On Tue, Nov 21, 2017 at 05:48:15PM +1100, Dave Chinner wrote: > On Mon, Nov 20, 2017 at 08:32:40PM -0800, Matthew Wilcox wrote: > > On Mon, Nov 20, 2017 at 05:37:53PM -0800, Darrick J. Wong wrote: > > > On Tue, Nov 21, 2017 at 09:27:49AM +1100, Dave Chinner wrote: > > > > First thing I noticed was

Re: [PATCH v2] iomap: report collisions between directio and buffered writes to userspace

2017-11-20 Thread Dave Chinner
On Mon, Nov 20, 2017 at 08:32:40PM -0800, Matthew Wilcox wrote: > On Mon, Nov 20, 2017 at 05:37:53PM -0800, Darrick J. Wong wrote: > > On Tue, Nov 21, 2017 at 09:27:49AM +1100, Dave Chinner wrote: > > > First thing I noticed was that "xa" as a prefix is already quite > > > widely used in XFS -

Re: [PATCH v2] iomap: report collisions between directio and buffered writes to userspace

2017-11-20 Thread Matthew Wilcox
On Mon, Nov 20, 2017 at 05:37:53PM -0800, Darrick J. Wong wrote: > On Tue, Nov 21, 2017 at 09:27:49AM +1100, Dave Chinner wrote: > > First thing I noticed was that "xa" as a prefix is already quite > > widely used in XFS - it's shorthand for "XFS AIL". Indeed, xa_lock > > already exists and is

Re: [PATCH v2] iomap: report collisions between directio and buffered writes to userspace

2017-11-20 Thread Darrick J. Wong
On Tue, Nov 21, 2017 at 09:27:49AM +1100, Dave Chinner wrote: > On Mon, Nov 20, 2017 at 01:51:00PM -0800, Matthew Wilcox wrote: > > On Tue, Nov 21, 2017 at 07:26:06AM +1100, Dave Chinner wrote: > > > On Mon, Nov 20, 2017 at 08:18:29AM -0800, Matthew Wilcox wrote: > > > > On Fri, Nov 17, 2017 at

Re: [PATCH v2] iomap: report collisions between directio and buffered writes to userspace

2017-11-20 Thread Dave Chinner
On Mon, Nov 20, 2017 at 01:51:00PM -0800, Matthew Wilcox wrote: > On Tue, Nov 21, 2017 at 07:26:06AM +1100, Dave Chinner wrote: > > On Mon, Nov 20, 2017 at 08:18:29AM -0800, Matthew Wilcox wrote: > > > On Fri, Nov 17, 2017 at 11:39:25AM -0800, Darrick J. Wong wrote: > > > > If two programs

Re: [PATCH v2] iomap: report collisions between directio and buffered writes to userspace

2017-11-20 Thread Matthew Wilcox
On Tue, Nov 21, 2017 at 07:26:06AM +1100, Dave Chinner wrote: > On Mon, Nov 20, 2017 at 08:18:29AM -0800, Matthew Wilcox wrote: > > On Fri, Nov 17, 2017 at 11:39:25AM -0800, Darrick J. Wong wrote: > > > If two programs simultaneously try to write to the same part of a file > > > via direct IO and

Re: [PATCH v2] iomap: report collisions between directio and buffered writes to userspace

2017-11-20 Thread Dave Chinner
On Mon, Nov 20, 2017 at 08:18:29AM -0800, Matthew Wilcox wrote: > On Fri, Nov 17, 2017 at 11:39:25AM -0800, Darrick J. Wong wrote: > > If two programs simultaneously try to write to the same part of a file > > via direct IO and buffered IO, there's a chance that the post-diowrite > > pagecache

Re: [PATCH v2] iomap: report collisions between directio and buffered writes to userspace

2017-11-20 Thread Matthew Wilcox
On Fri, Nov 17, 2017 at 11:39:25AM -0800, Darrick J. Wong wrote: > If two programs simultaneously try to write to the same part of a file > via direct IO and buffered IO, there's a chance that the post-diowrite > pagecache invalidation will fail on the dirty page. When this happens, > the dio

Re: [PATCH v2] iomap: report collisions between directio and buffered writes to userspace

2017-11-17 Thread Liu Bo
On Fri, Nov 17, 2017 at 11:39:25AM -0800, Darrick J. Wong wrote: > From: Darrick J. Wong > > If two programs simultaneously try to write to the same part of a file > via direct IO and buffered IO, there's a chance that the post-diowrite > pagecache invalidation will fail

[PATCH v2] iomap: report collisions between directio and buffered writes to userspace

2017-11-17 Thread Darrick J. Wong
From: Darrick J. Wong If two programs simultaneously try to write to the same part of a file via direct IO and buffered IO, there's a chance that the post-diowrite pagecache invalidation will fail on the dirty page. When this happens, the dio write succeeded, which