diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index eabf7f1e646f..b1508400c85c 100755 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -9249,11 +9249,6 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env) !preferred_cluster(cpu_rq(env->dst_cpu)->cluster, p)) return 0; - /* Don't detach task if it doesn't fit on the destination */ - if (env->flags & LBF_IGNORE_BIG_TASKS && - !task_fits_max(p, env->dst_cpu)) - return 0; - #ifdef CONFIG_SCHED_SEC_TASK_BOOST /* * Don't detach low priority task from mid/little cluster to prime cluster @@ -9268,6 +9263,11 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env) #endif /* CONFIG_SCHED_SEC_TASK_BOOST */ #endif + /* Don't detach task if it doesn't fit on the destination */ + if (env->flags & LBF_IGNORE_BIG_TASKS && + !task_fits_max(p, env->dst_cpu)) + return 0; + if (task_running(env->src_rq, p)) { schedstat_inc(p->se.statistics.nr_failed_migrations_running); return 0;