sched/fair: Return -1 from find_energy_efficient_cpu() if no CPU fits
The root_domain overutilized flag is meant to be used as a disabling condition for find_energy_efficient_cpu() (feec()). Since the utilization of any running (or recently running) task is accounted in a CPU's util_avg, not having the overutilized flag raised should ensure there is at least one candidate (i.e. onto which the task fits) CPU in feec() for any waking task. There can however be cases where the overutilized flag hasn't been raised yet, but feec() would not find a fitting CPU (fit_capacity()) and consequently return the previous CPU: * If the util estimation breaks the fit_capacity() condition because of a sudden higher task util_avg, the result would be a single bad placement. Only the next tick would raise the root_domain overutilized flag. * If that same condition is broken because of a uclamp.min value too high to fit any CPU, feec() would indefinitely wakeup on prev_cpu, as such a uclamp.min value wouldn't raise overutilized. Detect such cases and fall-through to select_idle_capacity() by returning -1 from feec(). Patch-header-by:Valentin Schneider <valentin.schneider@arm.com> Signed-off-by:
Dietmar Eggemann <dietmar.eggemann@arm.com>
Loading
Please register or sign in to comment