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 <zkennedy87@gmail.com> and Danny Lin
<danny@kdrag0n.dev> for discovering this issue and creating this fix.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Change-Id: I95aec52f456977b61e7a5b4dc6fed01184c86b09
fourteen
Sultan Alsawaf 4 years ago committed by Jenna
parent 9c208ca1ef
commit 189885b1e5
  1. 10
      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;

Loading…
Cancel
Save