Re: [RFC v5 09/11] mm: Try spin lock in speculative path

2017-07-06 Thread Peter Zijlstra
On Thu, Jul 06, 2017 at 05:29:26PM +0200, Laurent Dufour wrote: > Based on the benchmarks I run, it doesn't fail so much often, but I was > thinking about adding some counters here. The system is accounting for > major page faults and minor ones, respectively current->maj_flt and >

Re: [RFC v5 09/11] mm: Try spin lock in speculative path

2017-07-06 Thread Peter Zijlstra
On Thu, Jul 06, 2017 at 05:29:26PM +0200, Laurent Dufour wrote: > Based on the benchmarks I run, it doesn't fail so much often, but I was > thinking about adding some counters here. The system is accounting for > major page faults and minor ones, respectively current->maj_flt and >

Re: [RFC v5 09/11] mm: Try spin lock in speculative path

2017-07-06 Thread Laurent Dufour
On 06/07/2017 16:48, Peter Zijlstra wrote: > On Thu, Jul 06, 2017 at 03:46:59PM +0200, Laurent Dufour wrote: >> On 05/07/2017 20:50, Peter Zijlstra wrote: >>> On Fri, Jun 16, 2017 at 07:52:33PM +0200, Laurent Dufour wrote: @@ -2294,8 +2295,19 @@ static bool pte_map_lock(struct vm_fault *vmf)

Re: [RFC v5 09/11] mm: Try spin lock in speculative path

2017-07-06 Thread Laurent Dufour
On 06/07/2017 16:48, Peter Zijlstra wrote: > On Thu, Jul 06, 2017 at 03:46:59PM +0200, Laurent Dufour wrote: >> On 05/07/2017 20:50, Peter Zijlstra wrote: >>> On Fri, Jun 16, 2017 at 07:52:33PM +0200, Laurent Dufour wrote: @@ -2294,8 +2295,19 @@ static bool pte_map_lock(struct vm_fault *vmf)

Re: [RFC v5 09/11] mm: Try spin lock in speculative path

2017-07-06 Thread Peter Zijlstra
On Thu, Jul 06, 2017 at 03:46:59PM +0200, Laurent Dufour wrote: > On 05/07/2017 20:50, Peter Zijlstra wrote: > > On Fri, Jun 16, 2017 at 07:52:33PM +0200, Laurent Dufour wrote: > >> @@ -2294,8 +2295,19 @@ static bool pte_map_lock(struct vm_fault *vmf) > >>if (vma_has_changed(vmf->vma,

Re: [RFC v5 09/11] mm: Try spin lock in speculative path

2017-07-06 Thread Peter Zijlstra
On Thu, Jul 06, 2017 at 03:46:59PM +0200, Laurent Dufour wrote: > On 05/07/2017 20:50, Peter Zijlstra wrote: > > On Fri, Jun 16, 2017 at 07:52:33PM +0200, Laurent Dufour wrote: > >> @@ -2294,8 +2295,19 @@ static bool pte_map_lock(struct vm_fault *vmf) > >>if (vma_has_changed(vmf->vma,

Re: [RFC v5 09/11] mm: Try spin lock in speculative path

2017-07-06 Thread Laurent Dufour
On 05/07/2017 20:50, Peter Zijlstra wrote: > On Fri, Jun 16, 2017 at 07:52:33PM +0200, Laurent Dufour wrote: >> @@ -2294,8 +2295,19 @@ static bool pte_map_lock(struct vm_fault *vmf) >> if (vma_has_changed(vmf->vma, vmf->sequence)) >> goto out; >> >> -pte =

Re: [RFC v5 09/11] mm: Try spin lock in speculative path

2017-07-06 Thread Laurent Dufour
On 05/07/2017 20:50, Peter Zijlstra wrote: > On Fri, Jun 16, 2017 at 07:52:33PM +0200, Laurent Dufour wrote: >> @@ -2294,8 +2295,19 @@ static bool pte_map_lock(struct vm_fault *vmf) >> if (vma_has_changed(vmf->vma, vmf->sequence)) >> goto out; >> >> -pte =

Re: [RFC v5 09/11] mm: Try spin lock in speculative path

2017-07-05 Thread Peter Zijlstra
On Fri, Jun 16, 2017 at 07:52:33PM +0200, Laurent Dufour wrote: > @@ -2294,8 +2295,19 @@ static bool pte_map_lock(struct vm_fault *vmf) > if (vma_has_changed(vmf->vma, vmf->sequence)) > goto out; > > - pte = pte_offset_map_lock(vmf->vma->vm_mm, vmf->pmd, > -

Re: [RFC v5 09/11] mm: Try spin lock in speculative path

2017-07-05 Thread Peter Zijlstra
On Fri, Jun 16, 2017 at 07:52:33PM +0200, Laurent Dufour wrote: > @@ -2294,8 +2295,19 @@ static bool pte_map_lock(struct vm_fault *vmf) > if (vma_has_changed(vmf->vma, vmf->sequence)) > goto out; > > - pte = pte_offset_map_lock(vmf->vma->vm_mm, vmf->pmd, > -

[RFC v5 09/11] mm: Try spin lock in speculative path

2017-06-16 Thread Laurent Dufour
There is a deadlock when a CPU is doing a speculative page fault and another one is calling do_unmap(). The deadlock occurred because the speculative path try to spinlock the pte while the interrupt are disabled. When the other CPU in the unmap's path has locked the pte then is waiting for all

[RFC v5 09/11] mm: Try spin lock in speculative path

2017-06-16 Thread Laurent Dufour
There is a deadlock when a CPU is doing a speculative page fault and another one is calling do_unmap(). The deadlock occurred because the speculative path try to spinlock the pte while the interrupt are disabled. When the other CPU in the unmap's path has locked the pte then is waiting for all