Re: [PATCH tip/locking/core v8 1/5] locking/qspinlock: Use _acquire/_release versions of cmpxchg & xchg

From: Davidlohr Bueso
Date: Mon Oct 19 2015 - 23:46:53 EST


On Tue, 20 Oct 2015, Boqun Feng wrote:

@@ -93,7 +94,7 @@ static __always_inline void queued_spin_unlock(struct qspinlock *lock)
/*
* smp_mb__before_atomic() in order to guarantee release semantics
*/
- smp_mb__before_atomic_dec();
+ smp_mb__before_atomic();
atomic_sub(_Q_LOCKED_VAL, &lock->val);

Just be curious, you don't use atomic_sub_release() here on purpose?

atomic_sub() does not imply barriers, so there's no relaxed variants; that's
only for _return() (and such) to the caller.

Thanks,
Davidlohr

Attachment: signature.asc
Description: Digital signature