]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ipc/sem.c: Always use only one queue for alter operations.
authorManfred Spraul <manfred@colorfullife.com>
Fri, 7 Jun 2013 00:09:48 +0000 (10:09 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 17 Jun 2013 08:20:48 +0000 (18:20 +1000)
commit39bfeb72c95210f2f4a54700f1b5877bfb0d872e
tree469896e00f9ba6624877f6c88e1ff0434118cec7
parent21e95a49cfca906a2b135db937f6381d4b7472f5
ipc/sem.c: Always use only one queue for alter operations.

There are two places that can contain alter operations:
- the global queue: sma->pending_alter
- the per-semaphore queues: sma->sem_base[].pending_alter.

Since one of the queues must be processed first, this causes an odd
priorization of the wakeups:
Right now, complex operations have priority over simple ops.

The patch restores the behavior of linux <=3.0.9: The longest
waiting operation has the highest priority.

This is done by using only one queue:
- if there are complex ops, then sma->pending_alter is used.
- otherwise, the per-semaphore queues are used.

As a side effect, do_smart_update_queue() becomes much simpler:
No more goto logic.

Signed-off-by: Manfred Spraul <manfred@colorfullife.com>
Acked-by: Rik van Riel <riel@redhat.com>
Cc: Davidlohr Bueso <davidlohr.bueso@hp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
ipc/sem.c