[RFC PATCH] powerpc/powernv: recheck lock bit in core_idle_lock_held after lwarx

Li Zhong zhong at linux.vnet.ibm.com
Tue Oct 25 16:09:36 AEDT 2016


> On 25 Oct 2016, at 12:15, Paul Mackerras <paulus at ozlabs.org> wrote:
> 
> On Tue, Oct 25, 2016 at 11:24:34AM +0800, Li Zhong wrote:
>> The core_idle_lock_held loops when the lock bit is held by others.
>> However, it is possible that after the lock bit is cleared, some one
>> else sees it first and sets the lock bit. And lwarx loads a value with
>> lock bit set, and the lock bit may be cleared in the following stwcx.
>> It is possible the first one is still executing in the critical section.
>> 
>> This patch rechecks the lock bit after lwarx, and go back to loop if it
>> is set.
> 
> You're quite correct, in fact I posted almost exactly the same patch a
> few days ago...  See http://patchwork.ozlabs.org/patch/684963/.


Forget to check the list before sending … 

One minor difference, maybe we can use bne- for the rechecking :)

Thanks, Zhong

> 
> Thanks,
> Paul.
> 



More information about the Linuxppc-dev mailing list