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

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

sched: Fix the bug in select_best_cpu() that returns -1 as target_cpu



select_best_cpu() has previous CPU's cluster bias which overrides
the best_cpu with best_sibling_cpu when the power cost is same.
When the power table is configured incorrectly or static_cpu_pwr_cost/
static_cluster_pwr_cost tunables are set to a large value, the
power_cost() for all candidate CPUs can return INT_MAX. So the
stats.min_cost is never changed from it's initial value i.e INT_MAX.

In the above scenario, we find stats.best_cpu >= 0 &&  stats.min_cost =
stats.best_sibling_cpu_cost = INT_MAX && stats.best_sibling_cpu_cost = -1
and replace best_cpu with best_sibling_cpu i.e -1.

Change-Id: I09829e278e41daaaff959428ff50927aba29104c
Signed-off-by: default avatarPavankumar Kondeti <pkondeti@codeaurora.org>
parent 9725c4d9
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