aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilly Tarreau <w@1wt.eu>2017-02-06 08:59:06 +0100
committerMister Oyster <oysterized@gmail.com>2017-04-11 10:58:49 +0200
commite0a22f1f8c5e34461bb388597ca264d73d5d943b (patch)
tree3e5862c2c323a0cbdc678efb213544d0f9e63f22
parent7aebbda72b69810575aa33067162a7e32504b270 (diff)
Revert "ipc/sem.c: optimize sem_lock()"
This reverts commit 901f6fedc5340d66e2ca67c70dfee926cb5a1ea0 (upstream commit 6d07b68ce16ae9535955ba2059dedba5309c3ca1). As suggested in commit 5864a2fd3088db73d47942370d0f7210a807b9bc (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: Willy Tarreau <w@1wt.eu>
-rw-r--r--ipc/sem.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/ipc/sem.c b/ipc/sem.c
index 47a15192b..3b968a028 100644
--- a/ipc/sem.c
+++ b/ipc/sem.c
@@ -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);