]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
sched: Force balancing on newidle balance if local group has capacity
authorNikhil Rao <ncrao@google.com>
Thu, 10 Feb 2011 09:23:25 +0000 (10:23 +0100)
committerAK <andi@firstfloor.org>
Thu, 31 Mar 2011 18:57:59 +0000 (11:57 -0700)
commitea529386cb43daded114d0b8804060e32b2c3e9d
tree3fd88063fc94631c3640353c5ce81584eceeaf3d
parent56cb45ba8f738f979621b4f91b21908b4226bbe6
sched: Force balancing on newidle balance if local group has capacity

Commit: fab476228ba37907ad75216d0fd9732ada9c119e upstream

This patch forces a load balance on a newly idle cpu when the local group has
extra capacity and the busiest group does not have any. It improves system
utilization when balancing tasks with a large weight differential.

Under certain situations, such as a niced down task (i.e. nice = -15) in the
presence of nr_cpus NICE0 tasks, the niced task lands on a sched group and
kicks away other tasks because of its large weight. This leads to sub-optimal
utilization of the machine. Even though the sched group has capacity, it does
not pull tasks because sds.this_load >> sds.max_load, and f_b_g() returns NULL.

With this patch, if the local group has extra capacity, we shortcut the checks
in f_b_g() and try to pull a task over. A sched group has extra capacity if the
group capacity is greater than the number of running tasks in that group.

Thanks to Mike Galbraith for discussions leading to this patch and for the
insight to reuse SD_NEWIDLE_BALANCE.

Signed-off-by: Nikhil Rao <ncrao@google.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
LKML-Reference: <1287173550-30365-4-git-send-email-ncrao@google.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Mike Galbraith <efault@gmx.de>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
kernel/sched_fair.c