• Manfred Spraul's avatar
    ipc/sem.c: optimize single semop operations · 636c6be8
    Manfred Spraul authored
    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: default avatarManfred Spraul <manfred@colorfullife.com>
    Cc: Nick Piggin <npiggin@suse.de>
    Cc: Pierre Peiffer <peifferp@gmail.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    636c6be8
sem.c 35.4 KB