Notes on locking for pagacache consistency (was: [PATCH 01/10] mm: pagecache add lock)

2018-05-23 Thread Kent Overstreet
On Fri, May 18, 2018 at 01:45:49PM -0400, Kent Overstreet wrote: > On Fri, May 18, 2018 at 08:53:30AM -0700, Christoph Hellwig wrote: > > On Fri, May 18, 2018 at 06:13:06AM -0700, Matthew Wilcox wrote: > > > > Historically, the only problematic case has been direct IO, and people > > > > have been

Re: [PATCH 01/10] mm: pagecache add lock

2018-05-23 Thread Kent Overstreet
On Wed, May 23, 2018 at 08:22:39AM -0700, Christoph Hellwig wrote: > On Sun, May 20, 2018 at 06:45:24PM -0400, Kent Overstreet wrote: > > > > > > Honestly I think this probably should be in the core. But IFF we move > > > it to the core the existing users of per-fs locks need to be moved > > >

Re: [PATCH 01/10] mm: pagecache add lock

2018-05-23 Thread Christoph Hellwig
On Sun, May 20, 2018 at 06:45:24PM -0400, Kent Overstreet wrote: > > > > Honestly I think this probably should be in the core. But IFF we move > > it to the core the existing users of per-fs locks need to be moved > > over first. E.g. XFS as the very first one, and at least ext4 and f2fs > >

Re: [PATCH 01/10] mm: pagecache add lock

2018-05-20 Thread Kent Overstreet
On Fri, May 18, 2018 at 08:53:30AM -0700, Christoph Hellwig wrote: > On Fri, May 18, 2018 at 06:13:06AM -0700, Matthew Wilcox wrote: > > > Historically, the only problematic case has been direct IO, and people > > > have been willing to say "well, if you mix buffered and direct IO you > > > get

Re: [PATCH 01/10] mm: pagecache add lock

2018-05-18 Thread Kent Overstreet
On Fri, May 18, 2018 at 08:53:30AM -0700, Christoph Hellwig wrote: > On Fri, May 18, 2018 at 06:13:06AM -0700, Matthew Wilcox wrote: > > > Historically, the only problematic case has been direct IO, and people > > > have been willing to say "well, if you mix buffered and direct IO you > > > get

Re: [PATCH 01/10] mm: pagecache add lock

2018-05-18 Thread Christoph Hellwig
On Fri, May 18, 2018 at 06:13:06AM -0700, Matthew Wilcox wrote: > > Historically, the only problematic case has been direct IO, and people > > have been willing to say "well, if you mix buffered and direct IO you > > get what you deserve", and that's probably not unreasonable. But now we > > have

Re: [PATCH 01/10] mm: pagecache add lock

2018-05-18 Thread Matthew Wilcox
On Fri, May 18, 2018 at 03:49:00AM -0400, Kent Overstreet wrote: > Add a per address space lock around adding pages to the pagecache - making it > possible for fallocate INSERT_RANGE/COLLAPSE_RANGE to work correctly, and also > hopefully making truncate and dio a bit saner. (moving this section

[PATCH 01/10] mm: pagecache add lock

2018-05-18 Thread Kent Overstreet
Add a per address space lock around adding pages to the pagecache - making it possible for fallocate INSERT_RANGE/COLLAPSE_RANGE to work correctly, and also hopefully making truncate and dio a bit saner. Signed-off-by: Kent Overstreet --- fs/inode.c| 1 +