Re: [PATCH] ipc/sem.c: [RFC] memory barrier in sem_lock()

2014-08-12 Thread Davidlohr Bueso
On Tue, 2014-08-12 at 21:43 +0200, Manfred Spraul wrote: > sem_lock right now contains an smp_mb(). > I think smp_rmb() would be sufficient - and performance of semop() with rmb() > is up to 10% faster. It would be a pairing of rmb() with spin_unlock(). > > The race we must protect against is: >

[PATCH] ipc/sem.c: [RFC] memory barrier in sem_lock()

2014-08-12 Thread Manfred Spraul
sem_lock right now contains an smp_mb(). I think smp_rmb() would be sufficient - and performance of semop() with rmb() is up to 10% faster. It would be a pairing of rmb() with spin_unlock(). The race we must protect against is: sem->lock is free sma->complex_count = 0 sma->sem_perm.lock held by t