Skip to content
Commit 6fc174fd authored by Dietmar Eggemann's avatar Dietmar Eggemann Committed by Deepak Kumar Mishra
Browse files

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: default avatarValentin Schneider <valentin.schneider@arm.com>
Signed-off-by: Dietmar Eggemann's avatarDietmar Eggemann <dietmar.eggemann@arm.com>
parent 47cc2a26
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