Re: [RFC] locking/rwsem: Avoid issuing wakeup before setting the reader waiter to nil

From: Peter Zijlstra
Date: Thu Nov 29 2018 - 17:06:02 EST


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 :-)