Re: [RFC PATCH 24/37] mm: implement speculative handling in __do_fault()

2021-04-08 Thread Matthew Wilcox
On Thu, Apr 08, 2021 at 01:37:34AM -0700, Michel Lespinasse wrote: > On Thu, Apr 08, 2021 at 08:13:43AM +0100, Matthew Wilcox wrote: > > On Thu, Apr 08, 2021 at 09:00:26AM +0200, Peter Zijlstra wrote: > > > On Wed, Apr 07, 2021 at 10:27:12PM +0100, Matthew Wilcox wrote: > > > > Doing I/O without an

Re: [RFC PATCH 24/37] mm: implement speculative handling in __do_fault()

2021-04-08 Thread Michel Lespinasse
On Thu, Apr 08, 2021 at 08:13:43AM +0100, Matthew Wilcox wrote: > On Thu, Apr 08, 2021 at 09:00:26AM +0200, Peter Zijlstra wrote: > > On Wed, Apr 07, 2021 at 10:27:12PM +0100, Matthew Wilcox wrote: > > > Doing I/O without any lock held already works; it just uses the file > > > refcount. It would

Re: [RFC PATCH 24/37] mm: implement speculative handling in __do_fault()

2021-04-08 Thread Peter Zijlstra
On Thu, Apr 08, 2021 at 08:13:43AM +0100, Matthew Wilcox wrote: > On Thu, Apr 08, 2021 at 09:00:26AM +0200, Peter Zijlstra wrote: > > On Wed, Apr 07, 2021 at 10:27:12PM +0100, Matthew Wilcox wrote: > > > Doing I/O without any lock held already works; it just uses the file > > > refcount. It would

Re: [RFC PATCH 24/37] mm: implement speculative handling in __do_fault()

2021-04-08 Thread Matthew Wilcox
On Thu, Apr 08, 2021 at 09:00:26AM +0200, Peter Zijlstra wrote: > On Wed, Apr 07, 2021 at 10:27:12PM +0100, Matthew Wilcox wrote: > > Doing I/O without any lock held already works; it just uses the file > > refcount. It would be better to use a vma refcount, as I already said. > > The original wo

Re: [RFC PATCH 24/37] mm: implement speculative handling in __do_fault()

2021-04-08 Thread Peter Zijlstra
On Wed, Apr 07, 2021 at 10:27:12PM +0100, Matthew Wilcox wrote: > Doing I/O without any lock held already works; it just uses the file > refcount. It would be better to use a vma refcount, as I already said. The original workload that I developed SPF for (wy back when) was prefaulting a singl

Re: [RFC PATCH 24/37] mm: implement speculative handling in __do_fault()

2021-04-07 Thread Matthew Wilcox
On Wed, Apr 07, 2021 at 02:20:27PM -0700, Michel Lespinasse wrote: > On Wed, Apr 07, 2021 at 04:40:34PM +0200, Peter Zijlstra wrote: > > On Tue, Apr 06, 2021 at 06:44:49PM -0700, Michel Lespinasse wrote: > > > In the speculative case, call the vm_ops->fault() method from within > > > an rcu read lo

Re: [RFC PATCH 24/37] mm: implement speculative handling in __do_fault()

2021-04-07 Thread Michel Lespinasse
On Wed, Apr 07, 2021 at 04:40:34PM +0200, Peter Zijlstra wrote: > On Tue, Apr 06, 2021 at 06:44:49PM -0700, Michel Lespinasse wrote: > > In the speculative case, call the vm_ops->fault() method from within > > an rcu read locked section, and verify the mmap sequence lock at the > > start of the sec

Re: [RFC PATCH 24/37] mm: implement speculative handling in __do_fault()

2021-04-07 Thread Peter Zijlstra
On Tue, Apr 06, 2021 at 06:44:49PM -0700, Michel Lespinasse wrote: > In the speculative case, call the vm_ops->fault() method from within > an rcu read locked section, and verify the mmap sequence lock at the > start of the section. A match guarantees that the original vma is still > valid at that

Re: [RFC PATCH 24/37] mm: implement speculative handling in __do_fault()

2021-04-06 Thread Matthew Wilcox
On Tue, Apr 06, 2021 at 07:53:20PM -0700, Michel Lespinasse wrote: > On Wed, Apr 07, 2021 at 03:35:27AM +0100, Matthew Wilcox wrote: > > On Tue, Apr 06, 2021 at 06:44:49PM -0700, Michel Lespinasse wrote: > > > In the speculative case, call the vm_ops->fault() method from within > > > an rcu read lo

Re: [RFC PATCH 24/37] mm: implement speculative handling in __do_fault()

2021-04-06 Thread Michel Lespinasse
On Wed, Apr 07, 2021 at 03:35:27AM +0100, Matthew Wilcox wrote: > On Tue, Apr 06, 2021 at 06:44:49PM -0700, Michel Lespinasse wrote: > > In the speculative case, call the vm_ops->fault() method from within > > an rcu read locked section, and verify the mmap sequence lock at the > > start of the sec

Re: [RFC PATCH 24/37] mm: implement speculative handling in __do_fault()

2021-04-06 Thread Matthew Wilcox
On Tue, Apr 06, 2021 at 06:44:49PM -0700, Michel Lespinasse wrote: > In the speculative case, call the vm_ops->fault() method from within > an rcu read locked section, and verify the mmap sequence lock at the > start of the section. A match guarantees that the original vma is still > valid at that

[RFC PATCH 24/37] mm: implement speculative handling in __do_fault()

2021-04-06 Thread Michel Lespinasse
In the speculative case, call the vm_ops->fault() method from within an rcu read locked section, and verify the mmap sequence lock at the start of the section. A match guarantees that the original vma is still valid at that time, and that the associated vma->vm_file stays valid while the vm_ops->fa