[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <3af22f3b-03ab-1d37-b2b1-b616adde7eb6@linux.vnet.ibm.com>
Date: Thu, 6 Jul 2017 15:46:59 +0200
From: Laurent Dufour <ldufour@...ux.vnet.ibm.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: paulmck@...ux.vnet.ibm.com, akpm@...ux-foundation.org,
kirill@...temov.name, ak@...ux.intel.com, mhocko@...nel.org,
dave@...olabs.net, jack@...e.cz,
Matthew Wilcox <willy@...radead.org>,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
haren@...ux.vnet.ibm.com, khandual@...ux.vnet.ibm.com,
npiggin@...il.com, bsingharora@...il.com,
Tim Chen <tim.c.chen@...ux.intel.com>
Subject: Re: [RFC v5 09/11] mm: Try spin lock in speculative path
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 = pte_offset_map_lock(vmf->vma->vm_mm, vmf->pmd,
>> - vmf->address, &ptl);
>> + /* Same as pte_offset_map_lock() except that we call
>
> comment style..
Hi Peter and thanks for your work and review.
I'll fix this comment style.
>
>> + * spin_trylock() in place of spin_lock() to avoid race with
>> + * unmap path which may have the lock and wait for this CPU
>> + * to invalidate TLB but this CPU has irq disabled.
>> + * Since we are in a speculative patch, accept it could fail
>> + */
>> + ptl = pte_lockptr(vmf->vma->vm_mm, vmf->pmd);
>> + pte = pte_offset_map(vmf->pmd, vmf->address);
>> + if (unlikely(!spin_trylock(ptl))) {
>> + pte_unmap(pte);
>> + goto out;
>> + }
>> +
>> if (vma_has_changed(vmf->vma, vmf->sequence)) {
>> pte_unmap_unlock(pte, ptl);
>> goto out;
>
> Right, so if you look at my earlier patches you'll see I did something
> quite disgusting here.
>
> Not sure that wants repeating, but I cannot remember why I thought this
> deadlock didn't exist anymore.
Regarding the deadlock I did face it on my Power victim node, so I guess it
is still there, and the stack traces are quiet explicit.
Am I missing something here ?
Thanks,
Laurent.
Powered by blists - more mailing lists