]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
sched/fair: Do not try to migrate delayed dequeue task
authorVincent Guittot <vincent.guittot@linaro.org>
Mon, 2 Dec 2024 17:46:05 +0000 (18:46 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Mon, 9 Dec 2024 10:48:13 +0000 (11:48 +0100)
Migrating a delayed dequeued task doesn't help in balancing the number
of runnable tasks in the system.

Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Link: https://lore.kernel.org/r/20241202174606.4074512-11-vincent.guittot@linaro.org
kernel/sched/fair.c

index 84c0191a8ffabab499ae2ad686249581b03f7d31..2aa1d0cb68213c992c75d7535469310af27f56ea 100644 (file)
@@ -9391,11 +9391,15 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env)
 
        /*
         * We do not migrate tasks that are:
-        * 1) throttled_lb_pair, or
-        * 2) cannot be migrated to this CPU due to cpus_ptr, or
-        * 3) running (obviously), or
-        * 4) are cache-hot on their current CPU.
+        * 1) delayed dequeued unless we migrate load, or
+        * 2) throttled_lb_pair, or
+        * 3) cannot be migrated to this CPU due to cpus_ptr, or
+        * 4) running (obviously), or
+        * 5) are cache-hot on their current CPU.
         */
+       if ((p->se.sched_delayed) && (env->migration_type != migrate_load))
+               return 0;
+
        if (throttled_lb_pair(task_group(p), env->src_cpu, env->dst_cpu))
                return 0;