diff options
| author | Patrick Bellasi <patrick.bellasi@arm.com> | 2016-07-28 16:39:27 +0100 |
|---|---|---|
| committer | John Stultz <john.stultz@linaro.org> | 2016-08-10 15:16:02 -0700 |
| commit | 28e8cb961c2f71a89e391335a9304c3dd8b38d8f (patch) | |
| tree | ab0dec93f50969587dc3b609c65633e7efe9bfe4 /kernel | |
| parent | c50cc2299cb1a9ae769c955f5dd09a9648b1600e (diff) | |
FIX: sched/tune: update usage of boosted task utilisation on CPU selection
A boosted task needs to be scheduled on a CPU which can grant a minimum
capacity which is higher than its utilization.
However, a task can be allocated on a CPU which already provides an utilization
which is higher than the task boosted utilization itself.
Moreover, with the previous approach a task 100% boosted is not fitting any
CPU.
This patch makes use of the boosted task utilization just as a threashold
which defines the minimum capacity should be available on a CPU to host that
task.
Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/sched/fair.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 88aca75a6659..9e1935b6e340 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5636,6 +5636,7 @@ static int energy_aware_wake_cpu(struct task_struct *p, int target, int sync) struct sched_group *sg, *sg_target; int target_max_cap = INT_MAX; int target_cpu = task_cpu(p); + unsigned long task_util_boosted, new_util; int i; if (sysctl_sched_sync_hint_enable && sync) { @@ -5679,6 +5680,7 @@ static int energy_aware_wake_cpu(struct task_struct *p, int target, int sync) } } while (sg = sg->next, sg != sd->groups); + task_util_boosted = boosted_task_util(p); /* Find cpu with sufficient capacity */ for_each_cpu_and(i, tsk_cpus_allowed(p), sched_group_cpus(sg_target)) { /* @@ -5686,8 +5688,13 @@ static int energy_aware_wake_cpu(struct task_struct *p, int target, int sync) * so prev_cpu will receive a negative bias due to the double * accounting. However, the blocked utilization may be zero. */ - int new_util = cpu_util(i) + boosted_task_util(p); + new_util = cpu_util(i) + task_util_boosted; + /* + * Ensure minimum capacity to grant the required boost. + * The target CPU can be already at a capacity level higher + * than the one required to boost the task. + */ if (new_util > capacity_orig_of(i)) continue; |
