From 189885b1e5cd0f8edb05d81ae219ec33d833080a Mon Sep 17 00:00:00 2001 From: Sultan Alsawaf Date: Thu, 28 Jan 2021 19:18:13 -0800 Subject: [PATCH] sched/fair: Don't remove important task migration logic from PELT This task migration logic is guarded by a WALT #ifdef even though it has nothing specific to do with WALT. The result is that, with PELT, boosted tasks can be migrated to the little cluster, causing visible stutters. Move the WALT #ifdef so PELT can benefit from this logic as well. Thanks to Zachariah Kennedy and Danny Lin for discovering this issue and creating this fix. Signed-off-by: Sultan Alsawaf Change-Id: I95aec52f456977b61e7a5b4dc6fed01184c86b09 --- kernel/sched/fair.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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;