summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorJuri Lelli <juri.lelli@arm.com>2015-06-25 14:37:27 +0100
committerAmit Pundir <amit.pundir@linaro.org>2016-09-14 14:58:22 +0530
commitc25759ccb88d84b91af1657eb8fafd9dda9c8a94 (patch)
treef6c056bec8f2eeaf6305de98f7d7cdfb273913d6 /kernel
parenta0933a372d84e341911f2a09cdb9980584315f03 (diff)
sched/fair: cpufreq_sched triggers for load balancing
As we don't trigger freq changes from {en,de}queue_task_fair() during load balancing, we need to do explicitly so on load balancing paths. [smuckle@linaro.org: move update_capacity_of calls so rq lock is held] cc: Ingo Molnar <mingo@redhat.com> cc: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Juri Lelli <juri.lelli@arm.com> Signed-off-by: Steve Muckle <smuckle@linaro.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched/fair.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 4558c6ac2a66..8f93b23596e5 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6405,6 +6405,10 @@ static void attach_one_task(struct rq *rq, struct task_struct *p)
{
raw_spin_lock(&rq->lock);
attach_task(rq, p);
+ /*
+ * We want to potentially raise target_cpu's OPP.
+ */
+ update_capacity_of(cpu_of(rq));
raw_spin_unlock(&rq->lock);
}
@@ -6426,6 +6430,11 @@ static void attach_tasks(struct lb_env *env)
attach_task(env->dst_rq, p);
}
+ /*
+ * We want to potentially raise env.dst_cpu's OPP.
+ */
+ update_capacity_of(env->dst_cpu);
+
raw_spin_unlock(&env->dst_rq->lock);
}
@@ -7688,6 +7697,11 @@ more_balance:
* ld_moved - cumulative load moved across iterations
*/
cur_ld_moved = detach_tasks(&env);
+ /*
+ * We want to potentially lower env.src_cpu's OPP.
+ */
+ if (cur_ld_moved)
+ update_capacity_of(env.src_cpu);
/*
* We've detached some tasks from busiest_rq. Every
@@ -8058,8 +8072,13 @@ static int active_load_balance_cpu_stop(void *data)
schedstat_inc(sd, alb_count);
p = detach_one_task(&env);
- if (p)
+ if (p) {
schedstat_inc(sd, alb_pushed);
+ /*
+ * We want to potentially lower env.src_cpu's OPP.
+ */
+ update_capacity_of(env.src_cpu);
+ }
else
schedstat_inc(sd, alb_failed);
}