diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 3121ad039471..171af59af20c 100755 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -7711,6 +7711,13 @@ static inline int find_best_target(struct task_struct *p, int *backup_cpu, if (best_idle_cpu != -1) continue; + /* + * Skip searching for active CPU for tasks have + * high priority & stune.boost. + */ + if (boosted && p->prio <= DEFAULT_PRIO) + continue; + /* * Case A.2: Target ACTIVE CPU * Favor CPUs with max spare capacity. @@ -7938,7 +7945,9 @@ static inline int find_best_target(struct task_struct *p, int *backup_cpu, #ifdef CONFIG_SCHED_WALT if (target_cpu == -1 && most_spare_cap_cpu != -1 && /* ensure we use active cpu for active migration */ - !(p->state == TASK_RUNNING && !idle_cpu(most_spare_cap_cpu))) + !(p->state == TASK_RUNNING && !idle_cpu(most_spare_cap_cpu)) && + /* do not pick an overutilized most_spare_cap_cpu */ + !cpu_overutilized(most_spare_cap_cpu)) target_cpu = most_spare_cap_cpu; #endif