sched/numa: Fix off-by-one in capacity check
[firefly-linux-kernel-4.4.55.git] / kernel / sched / fair.c
index df1ed176c7b7bf1ea2610e5eefc3ba2e8da498cd..e1cf419c3c7ffd63a64b792b005d805be07c058e 100644 (file)
@@ -1206,7 +1206,7 @@ static void task_numa_compare(struct task_numa_env *env,
 
        if (!cur) {
                /* Is there capacity at our destination? */
-               if (env->src_stats.has_free_capacity &&
+               if (env->src_stats.nr_running <= env->src_stats.task_capacity &&
                    !env->dst_stats.has_free_capacity)
                        goto unlock;