@@ -7418,13 +7418,8 @@ static int detach_tasks(struct lb_env *env)
break;
case migrate_misfit:
- load = task_h_load(p);
-
- /*
- * load of misfit task might decrease a bit since it has
- * been recorded. Be conservative in the condition.
- */
- if (load / 2 < env->imbalance)
+ /* This is not a misfit task */
+ if (task_fits_capacity(p, capacity_of(env->src_cpu)))
goto next;
env->imbalance = 0;
@@ -8368,7 +8363,7 @@ static inline void calculate_imbalance(struct lb_env *env, struct sd_lb_stats *s
if (busiest->group_type == group_misfit_task) {
/* Set imbalance to allow misfit task to be balanced. */
env->migration_type = migrate_misfit;
- env->imbalance = busiest->group_misfit_task_load;
+ env->imbalance = 1;
return;
}