From a5cb71df223160dc3ddeff332b8da8b689645fff Mon Sep 17 00:00:00 2001 From: Joonwoo Park Date: Wed, 11 Feb 2015 16:55:32 -0800 Subject: sched: avoid running idle_balance() on behalf of wrong CPU With EA (Energy Awareness), idle_balance() on a CPU runs on behalf of most power efficient idle CPU among the CPUs in its sched domain level under the condition that the substitute idle CPU should be limited to a CPU which has the same capacity with original idle CPU. It is found that at present idle_balance() spans all the CPUs in its sched domain and run idle balancer on behalf of any CPU within the domain which could be all the CPUs in the system which consequently makes idle balancer on a performance CPU always runs on behalf of a power efficient idle CPU. This would cause for idle performance CPUs to fail to pull tasks from power efficient CPUs always when there is only an online performance CPU. Limit search CPUs to cache sharing CPUs with original idle CPU to ensure to run idle balancre on behalf of more power efficient CPU but still has the same capacity with original CPU to fix such issue. Change-Id: I0575290c24f28db011d9353915186e64df7e57fe Signed-off-by: Joonwoo Park --- kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'kernel') diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index b757bfb94222..cc16d24352b2 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -9412,7 +9412,7 @@ static int idle_balance(struct rq *this_rq) * most power-efficient idle CPU. */ rcu_read_lock(); - sd = rcu_dereference_check_sched_domain(this_rq->sd); + sd = rcu_dereference(per_cpu(sd_llc, this_cpu)); if (sd && sysctl_sched_enable_power_aware) { for_each_cpu(i, sched_domain_span(sd)) { if (i == this_cpu || idle_cpu(i)) { -- cgit v1.2.3