Comments

a) The ACQUIRE in spin_lock() applies to the read, not to the store,
at least for powerpc. This forces to add a smp_mb() into the fast
path.
b) The memory barrier provided by spin_unlock_wait() is right now
arch dependent.
Therefore: Use spin_lock()/spin_unlock() instead of spin_unlock_wait().
Advantage: faster single op semop calls(), observed +8.9% on
x86. (the other solution would be arch dependencies in ipc/sem).
Disadvantage: slower complex op semop calls, if (and only if)
there are no sleeping operations.
The next patch adds hysteresis, this further reduces the
probability that the slow path is used.
Signed-off-by: Manfred Spraul <manfred@colorfullife.com>
---
ipc/sem.c | 25 +++----------------------
1 file changed, 3 insertions(+), 22 deletions(-)