ipc/sem.c: optimize single semop operations
authorManfred Spraul <manfred@colorfullife.com>
Wed, 16 Dec 2009 00:47:33 +0000 (16:47 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 16 Dec 2009 15:20:10 +0000 (07:20 -0800)
commit636c6be823870d829b37fc96655bb8820a6a9be9
treedc17d73ae77e6921ca7c88e6b019fe3d72bb9790
parentb97e820ffffbf49e94ed60c9c26f1a54bccae924
ipc/sem.c: optimize single semop operations

sysv sem has the concept of semaphore arrays that consist out of multiple
semaphores.  Atomic operations that affect multiple semaphores are
supported.

The patch optimizes single semaphore operation calls that affect only one
semaphore: It's not necessary to scan all pending operations, it is
sufficient to scan the per-semaphore list.

The idea is from Nick Piggin version of an ipc sem improvement, the
implementation is different: The code tries to keep as much common code as
possible.

As the result, the patch is simpler, but optimizes fewer cases.

Signed-off-by: Manfred Spraul <manfred@colorfullife.com>
Cc: Nick Piggin <npiggin@suse.de>
Cc: Pierre Peiffer <peifferp@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
ipc/sem.c