On Thu, May 19, 2016 at 10:39:26PM -0700, Davidlohr Bueso wrote:
As such, the following restores the behavior of the ticket locks and 'fixes'The actual bug is clear_pending_set_locked() not having acquire
(or hides?) the bug in sems. Naturally incorrect approach:
@@ -290,7 +290,8 @@ static void sem_wait_array(struct sem_array *sma)
for (i = 0; i< sma->sem_nsems; i++) {
sem = sma->sem_base + i;
- spin_unlock_wait(&sem->lock);
+ while (atomic_read(&sem->lock))
+ cpu_relax();
}
ipc_smp_acquire__after_spin_is_unlocked();
}
semantics. And the above 'fixes' things because it will observe the old
pending bit or the locked bit, so it doesn't matter if the store
flipping them is delayed.