sched: make double-lock-balance fair
authorGregory Haskins <ghaskins@novell.com>
Mon, 29 Dec 2008 14:39:51 +0000 (09:39 -0500)
committerGregory Haskins <ghaskins@novell.com>
Mon, 29 Dec 2008 14:39:51 +0000 (09:39 -0500)
double_lock balance() currently favors logically lower cpus since they
often do not have to release their own lock to acquire a second lock.
The result is that logically higher cpus can get starved when there is
a lot of pressure on the RQs.  This can result in higher latencies on
higher cpu-ids.

This patch makes the algorithm more fair by forcing all paths to have
to release both locks before acquiring them again.  Since callsites to
double_lock_balance already consider it a potential preemption/reschedule
point, they have the proper logic to recheck for atomicity violations.

Signed-off-by: Gregory Haskins <ghaskins@novell.com>
kernel/sched.c

diff --cc kernel/sched.c
Simple merge