Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 3a3643d0 authored by Pavankumar Kondeti's avatar Pavankumar Kondeti
Browse files

sched/fair: Return previous CPU when perf domains are not available



find_energy_efficient_cpu() returns -1 when perf domains are not
available. The perf domains are not accessible for a short duration,
when sched domains are rebuilt during CPU hotplug. Handle this
scenario by returning previous CPU instead of -1. The select_task_rq()
handles the case where the previous CPU is not eligible to run the
waking task, so no additional checks are needed.

At present it is not resulting in an incorrect memory access, because
select_task_rq() -> is_cpu_allowed() -> cpumask_test_cpu() interprets
-1 as all 1s and evaluate that the task can't run on it and forces
the fallback CPU selection. This can be caught by enabling
DEBUG_PER_CPU_MAPS debug config which prints a one time warning
when the cpu passed to a cpumask operation is invalid.

Change-Id: Ie31435f06f54236ac8b9ef278a8e1c361cf2f06a
Signed-off-by: default avatarPavankumar Kondeti <pkondeti@codeaurora.org>
parent 2fd9b6ce
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment