In some case, we just want to distinguish CPU capacity and compare CPU capacity between two CPUs. So we change to use capacity_orig_of. Current code if use capacity_of(), this function will return a dynamic value which is introduced by rt threads. So this will finally introduce misunderstanding when compare two CPUs in same cluster.
Signed-off-by: Leo Yan leo.yan@linaro.org --- kernel/sched/fair.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 604793d..ac4f509 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -8138,12 +8138,11 @@ static int need_active_balance(struct lb_env *env) return 1; }
- if ((capacity_of(env->src_cpu) < capacity_of(env->dst_cpu)) && - env->src_rq->cfs.h_nr_running == 1 && - cpu_overutilized(env->src_cpu) && - !cpu_overutilized(env->dst_cpu)) { - return 1; - } + if ((capacity_orig_of(env->src_cpu) < capacity_orig_of(env->dst_cpu)) && + env->src_rq->cfs.h_nr_running == 1 && + cpu_overutilized(env->src_cpu) && + !cpu_overutilized(env->dst_cpu)) + return 1;
return unlikely(sd->nr_balance_failed > sd->cache_nice_tries+2); } -- 1.9.1