From 504e400e6cbee66eaad9a62b3c138d211861bec9 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 19 Sep 2019 20:48:16 +0200 Subject: [PATCH] Revert "ANDROID: sched/fair: Don't balance misfits if it would overload local group" This reverts commit 67de53b177068aca219c11cb977e5d27720819c1. We want to back-out the eas-dev merge that happened in the tree after 5.3-rc1 as those patches "should" all be in Linus's tree now. This is done to handle the merge conflicts with 5.4-rc1. Cc: Todd Kjos Signed-off-by: Greg Kroah-Hartman Change-Id: I8b1a8909ce8d5eb8d1660586a8706fb6a674d751 --- kernel/sched/fair.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 72529727d57c..057795ca09d6 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -8545,18 +8545,8 @@ static inline void calculate_imbalance(struct lb_env *env, struct sd_lb_stats *s (sds->avg_load - local->avg_load) * local->group_capacity ) / SCHED_CAPACITY_SCALE; - /* Boost imbalance to allow misfit task to be balanced. - * Always do this if we are doing a NEWLY_IDLE balance - * on the assumption that any tasks we have must not be - * long-running (and hence we cannot rely upon load). - * However if we are not idle, we should assume the tasks - * we have are longer running and not override load-based - * calculations above unless we are sure that the local - * group is underutilized. - */ - if (busiest->group_type == group_misfit_task && - (env->idle == CPU_NEWLY_IDLE || - local->sum_nr_running < local->group_weight)) { + /* Boost imbalance to allow misfit task to be balanced. */ + if (busiest->group_type == group_misfit_task) { env->imbalance = max_t(long, env->imbalance, busiest->group_misfit_task_load); }