Skip to content
Commit 5868d172 authored by Dietmar Eggemann's avatar Dietmar Eggemann Committed by Ionela Voinescu
Browse files

sched/fair: Introduce best_cap_cpu in find_energy_efficient_cpu()



In case a task p has a uclamp min (boost) value which is > 80% of the
capacity of:

(1) prev_cpu and

(2) any possible max_spare_cap_cpu

find_energy_efficient_cpu() (feec()) prev_delta and best_delta stay at
their initial value (ULONG_MAX).

In this case prev_cpu will be returned via the condition:

  if (prev_delta == ULONG_MAX)
     return best_energy_cpu /* initialized to prev_cpu */.

This includes scenarios in which p's uclamp min [0 ... 1024] is > 819 so
none of the CPUs (even un-pressured big CPUs w/ capacity = 1024) will
fit this util (filtered by uclamp_rq_util_with(..., p)).

To fix this maintain a system (sd_asym_cpucapacity)-wide best_cap_cpu
which is returned if p doesn't fit on any CPU.

The best_cap_cpu follows the fallback idea of the best_cpu in
select_idle_capacity(). It should not be confused with feec()'s per perf
domain max_spare_cap_cpu.

The rationale behind this idea is that if p requests a boost value
which can't be served at the time of the wakeup it should at least be
placed on the max capacity CPU.

XXX:

(a) In case we use 'sched/eas: Fix task_fits_capacity() handling of boosting'
    the use case 'p's uclamp min [0 ... 1024] is > 819 on unpressured CPUs'
    is no longer there. So this patch only would have an effect on systems
    where the big CPUs are pressured.

(b) feec()'s function header has to be amended to mention the new logic.

Reported-by: default avatarYun Hsiang <hsiang023167@gmail.com>
Suggested-by: default avatarYun Hsiang <hsiang023167@gmail.com>
Signed-off-by: Dietmar Eggemann's avatarDietmar Eggemann <dietmar.eggemann@arm.com>
parent 935fcfaf
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment