summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorJoonwoo Park <joonwoop@codeaurora.org>2015-02-11 16:55:32 -0800
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:01:43 -0700
commita5cb71df223160dc3ddeff332b8da8b689645fff (patch)
treef6252e9da3d3c00a781b9180885d4c8e22370e3a /kernel
parentc41a54cb8dfbfa7e363b2d1df530e819b7624b7d (diff)
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 <joonwoop@codeaurora.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched/fair.c2
1 files changed, 1 insertions, 1 deletions
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)) {