ANDROID: sched/fair: Fall back to slow path wakeup placement if needed
Sometimes we can be in a scenario where we are unable to calculate an
energy-aware task placement. This can happen for a few reasons.
1. We might be racing with a hotplug and be unable to access the
whole-system energy structures
2. The system might be in a condition (due to task size and load)
whereby there is only one potential place to put a task (when
we consider avoiding overutilization etc.).
3. There might actually be no non-overutilized sched domain in
the system where the current task would fit.
We handle case 3 directly in select_task_rq_fair - there is no point
even checking what the energy situation might be since we can already
tell that it is not possible to do an energy-aware placement of this
task. When that is apparent, we null out the energy_sd and fallback to
the regular slow-path wakeup (which is also capacity-aware).
For the other cases, we can't tell we are in such a scenario until we do
at least a little further digging. Allow find_energy_efficient_cpu to
return -1 to indicate that we did not attempt an energy-aware wakeup as
either we couldn't or there was only one potential candidate.
When that happens, we will set new_cpu == -1 and drop again into
find_idlest_cpu to place the task (which is capacity aware).
Change-Id: I65454ea7bba6b85ee0467f28929650e80cba0cab
Signed-off-by:
Chris Redpath <chris.redpath@arm.com>
Loading
Please register or sign in to comment