Current code will check tipping point in load balance when calculate schedule group load and utilization. But it will not distinguish if CPU is in idle state or not, so as result it may wrongly think some idle CPU is overutilized when this CPU has stale utilization value and this value has never been updated since the CPU entered idle state.
There have two methods to fix this issue, one method is to check if CPU is in idle state in function cpu_overutilized(), so can directly return back false when CPU has been staying in idle state. Another method is to check CPU idle state in function update_sg_lb_stats(), so avoid to set tipping point for idle CPUs.
This patch tries to fix issue with the second method.
Signed-off-by: Leo Yan leo.yan@linaro.org --- kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 5b9e227..594d050 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -7435,7 +7435,7 @@ static inline void update_sg_lb_stats(struct lb_env *env, if (!nr_running && idle_cpu(i)) sgs->idle_cpus++;
- if (cpu_overutilized(i)) { + if (cpu_overutilized(i) && !idle_cpu(i)) { *overutilized = true; if (!sgs->group_misfit_task && rq->misfit_task) sgs->group_misfit_task = capacity_of(i); -- 1.9.1