[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c1c9d6b30d7745ea9ac5b752f9a506c3@baidu.com>
Date: Fri, 30 Nov 2018 09:34:19 +0000
From: "Liu,Qi(ACU-T1)" <liuqi16@...du.com>
To: 'Peter Zijlstra' <peterz@...radead.org>,
Waiman Long <longman@...hat.com>
CC: Will Deacon <will.deacon@....com>, Yongji Xie <elohimes@...il.com>,
"mingo@...hat.com" <mingo@...hat.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"Xie,Yongji" <xieyongji@...du.com>,
"Zhang,Yu(ACU-T1)" <zhangyu31@...du.com>,
"Yuan,Linsi" <yuanlinsi01@...du.com>, "Ni,Xun" <nixun@...du.com>,
"Li,Lin(ACU-T1)" <lilin24@...du.com>,
Davidlohr Bueso <dave@...olabs.net>
Subject: 答复: [RFC] locking/rwsem: Avoid issuing wakeup 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
smp_mb__before_atomic()
cmpxchg_relaxed() // no barrier
to get rid of the redundant barrier
smp_mb__before_atomic()
cmpxchg() // imply a redundant barrier when successing
-----邮件原件-----
发件人: Peter Zijlstra [mailto:peterz@...radead.org]
发送时间: 2018年11月30日 6:06
收件人: Waiman Long <longman@...hat.com>
抄送: Will Deacon <will.deacon@....com>; Yongji Xie <elohimes@...il.com>; mingo@...hat.com; linux-kernel@...r.kernel.org; Xie,Yongji <xieyongji@...du.com>; Zhang,Yu(ACU-T1) <zhangyu31@...du.com>; Liu,Qi(ACU-T1) <liuqi16@...du.com>; Yuan,Linsi <yuanlinsi01@...du.com>; Ni,Xun <nixun@...du.com>; Li,Lin(ACU-T1) <lilin24@...du.com>; Davidlohr Bueso <dave@...olabs.net>
主题: 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.
smp_mb__before_atomic()
cmpxchg_relaxed()
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 :-)
Powered by blists - more mailing lists