[lkml]   [2018]   [Nov]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subject答复: [RFC] locking/rwsem: Avoid issuing wake up before setting the reader waiter to nil
Is there a semantic divergence between x86 instruction "LOCK cmpxchg" and the macro cmpxchg defined in linux kernel? The former guarantee full barrier in any case, and the latter only imply barrier in case of success?
So, we use
cmpxchg_relaxed() // no barrier
to get rid of the redundant barrier
cmpxchg() // imply a redundant barrier when successing

发件人: Peter Zijlstra []
发送时间: 2018年11月30日 6:06
收件人: Waiman Long <>
抄送: Will Deacon <>; Yongji Xie <>;;; Xie,Yongji <>; Zhang,Yu(ACU-T1) <>; Liu,Qi(ACU-T1) <>; Yuan,Linsi <>; Ni,Xun <>; Li,Lin(ACU-T1) <>; Davidlohr Bueso <>
主题: Re: [RFC] locking/rwsem: Avoid issuing wakeup before setting the reader waiter to nil

On Thu, Nov 29, 2018 at 01:34:05PM -0500, Waiman Long wrote:

> That will certainly work for x86. However, I am not sure if that will
> be optimal for arm and powerpc.


works. Also see pv_kick_node()'s commit:

34d54f3d6917 ("locking/pvqspinlock: Relax cmpxchg's to improve performance on some architectures")

you might know the author of that :-)
 \ /
  Last update: 2018-11-30 11:21    [W:0.072 / U:8.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site