Commit 3d971ee1 authored by Willy Tarreau's avatar Willy Tarreau

Revert "ipc/sem.c: optimize sem_lock()"

This reverts commit 901f6fed
(upstream commit 6d07b68c).

As suggested in commit 5864a2fd
(ipc/sem.c: fix complex_count vs. simple op race) since it introduces
a regression and the candidate fix requires too many changes for 3.10.

Cc: Manfred Spraul <manfred@colorfullife.com>
Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
parent 9c559b0f
......@@ -267,20 +267,12 @@ static void sem_rcu_free(struct rcu_head *head)
* Caller must own sem_perm.lock.
* New simple ops cannot start, because simple ops first check
* that sem_perm.lock is free.
* that a) sem_perm.lock is free and b) complex_count is 0.
*/
static void sem_wait_array(struct sem_array *sma)
{
int i;
struct sem *sem;
if (sma->complex_count) {
/* The thread that increased sma->complex_count waited on
* all sem->lock locks. Thus we don't need to wait again.
*/
return;
}
for (i = 0; i < sma->sem_nsems; i++) {
sem = sma->sem_base + i;
spin_unlock_wait(&sem->lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment