]> 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>
Wed, 19 Jun 2013 00:08:32 +0000 (10:08 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 19 Jun 2013 07:27:47 +0000 (17:27 +1000)
commit29395f3f6174ce4d9f297494ff6d3ff076c19b6b
tree22795d85fb114a102d241533dcce1158b11c89ee
parented4852525344edac92dc95d3e2065aa00fc9f074
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>
Cc: 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