sched: walt: Ensure only valid cpu selected

Under FBT, we currently do not check if an active candidate is actually
valid before setting it as part of the candidates mask. This can lead to
page faults.

Change-Id: I5aedb3bd1e076736270aa03b8889c67606c2a25d
Signed-off-by: Shaleen Agrawal <shalagra@codeaurora.org>
This commit is contained in:
Shaleen Agrawal 2021-06-24 14:57:44 -07:00 committed by Rishabh Bhatnagar
parent 228d91e408
commit 5c3c385a68

View File

@ -448,7 +448,7 @@ static void walt_find_best_target(struct sched_domain *sd,
if (unlikely(cpumask_empty(candidates))) {
if (most_spare_cap_cpu != -1)
cpumask_set_cpu(most_spare_cap_cpu, candidates);
else if (!cpu_active(prev_cpu))
else if (!cpu_active(prev_cpu) && active_candidate != -1)
cpumask_set_cpu(active_candidate, candidates);
}