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:Yun Hsiang <hsiang023167@gmail.com> Suggested-by:
Yun Hsiang <hsiang023167@gmail.com> Signed-off-by:
Dietmar Eggemann <dietmar.eggemann@arm.com>
Loading
Please register or sign in to comment