]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ipc semaphores: order wakeups based on waiter CPU
authorChris Mason <chris.mason@oracle.com>
Tue, 5 Jul 2011 19:07:25 +0000 (14:07 -0500)
committerGuru Anbalagane <guru.anbalagane@oracle.com>
Wed, 24 Aug 2011 00:37:24 +0000 (17:37 -0700)
commit8102e1ff9d667661b581209323faaf7a84f0f528
tree70ddfb44fb87296310a8f85775e5893173eac990
parentc7fa322dd72b08450a440ef800124705a1fa148c
ipc semaphores: order wakeups based on waiter CPU

When IPC semaphores are used in a bulk post and wait system, we
can end up waking a very large number of processes per semtimedop call.
At least one major database will use a single process to kick hundreds
of other processes at a time.

This patch tries to reduce the runqueue lock contention by ordering the
wakeups based on the CPU the waiting process was on when it went to
sleep.

A later patch could add some code in the scheduler to help
wake these up in bulk and take the various runqueue locks less often.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
include/linux/sem.h
ipc/sem.c