sched: walt: Fixup root domain selection

In WALT task placement algorithm, we select the root domain to be the
root domain corresponding to the current cpu, however, this could be
null if the cpu is inactive. This, in fact, resulted in undesired
behaviour when evaluating a single old threaded usecase, since desired
cpu was inactive, thread was being placed on a fallback cpu.

Change-Id: I68eef10dc84db15796a0d43af7215f4dbbdc059e
Signed-off-by: Shaleen Agrawal <shalagra@codeaurora.org>
This commit is contained in:
Shaleen Agrawal 2021-01-27 09:22:25 -08:00 committed by Rishabh Bhatnagar
parent 11cab5f8ab
commit d5d3d33ff3

View File

@ -552,7 +552,7 @@ int walt_find_energy_efficient_cpu(struct task_struct *p, int prev_cpu,
int sync, int sibling_count_hint)
{
unsigned long prev_delta = ULONG_MAX, best_delta = ULONG_MAX;
struct root_domain *rd = cpu_rq(smp_processor_id())->rd;
struct root_domain *rd = cpu_rq(cpumask_first(cpu_active_mask))->rd;
int weight, cpu = smp_processor_id(), best_energy_cpu = prev_cpu;
struct perf_domain *pd;
unsigned long cur_energy;