summaryrefslogtreecommitdiff
path: root/kernel/sched
diff options
context:
space:
mode:
authorChris Redpath <chris.redpath@arm.com>2017-03-08 13:37:32 +0000
committerAndres Oportus <andresoportus@google.com>2017-06-02 08:01:54 -0700
commit83f462daa328f2f42c3c1f7f5277f71e3fa0f750 (patch)
tree737d331ebb1b749ce0f8cece20ba3b76eaa41c56 /kernel/sched
parent8865f07600fad56a7fc6b96dc339bbe9a16eb7eb (diff)
sched/fair: ensure utilization signals are synchronized before use
wake_cap performs task and cpu utilization synchronization which is what allows us to subtract current task util from prev_cpu util and have a sensible number to work with. It looks as though if wake_wide returns 0, we could potentially not execute wake_cap, which would result in unsynced signals we then use for energy calculations. This is not necessarily an issue we've seen in traces, but it looks as though it should be changed. Change-Id: Ic54a3cba2a10d946ea20113a04371dea04115e82 Signed-off-by: Chris Redpath <chris.redpath@arm.com>
Diffstat (limited to 'kernel/sched')
-rw-r--r--kernel/sched/fair.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 27a6f5d6c86c..23e2b5f33ff6 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6424,9 +6424,16 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int sd_flag, int wake_f
int want_affine = 0;
int sync = wake_flags & WF_SYNC;
- if (sd_flag & SD_BALANCE_WAKE)
- want_affine = !wake_wide(p) && !wake_cap(p, cpu, prev_cpu)
+ if (sd_flag & SD_BALANCE_WAKE) {
+ /*
+ * do wake_cap unconditionally as it causes task and cpu
+ * utilization to be synced, and we need that for energy
+ * aware wakeups
+ */
+ int _wake_cap = wake_cap(p, cpu, prev_cpu);
+ want_affine = !wake_wide(p) && !_wake_cap
&& cpumask_test_cpu(cpu, tsk_cpus_allowed(p));
+ }
if (energy_aware() && !(cpu_rq(prev_cpu)->rd->overutilized))
return select_energy_cpu_brute(p, prev_cpu, sync);