mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
sched/fair: Don't allow boosted tasks to be migrated to small cores
We want boosted tasks to run on big cores. But CAF's load balancer changes do not account for SchedTune boosting, so this allows for boosted tasks to be migrated to a suboptimal core. Let's mitigate this by setting the LBF_IGNORE_STUNE_BOOSTED_TASKS for tasks migrating from a larger capacity core to a min capacity one and that have a schedtune boost > 10. If both are true, do not migrate this task. If the next time the load balancer runs, the same task is selected, we clear the LBF_IGNORE_STUNE_BOOSTED_TASKS flag. Change-Id: Ibd9f6616b482d446d5acce2a93418bfda4c35ffb Signed-off-by: Zachariah Kennedy <zkennedy87@gmail.com> Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
This commit is contained in:
parent
6613d8add7
commit
d0661f464d
@ -9350,6 +9350,7 @@ enum group_type {
|
||||
#define LBF_ACTIVE_LB 0x10
|
||||
#define LBF_IGNORE_BIG_TASKS 0x100
|
||||
#define LBF_IGNORE_PREFERRED_CLUSTER_TASKS 0x200
|
||||
#define LBF_IGNORE_STUNE_BOOSTED_TASKS 0x400
|
||||
|
||||
struct lb_env {
|
||||
struct sched_domain *sd;
|
||||
@ -9552,6 +9553,11 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env)
|
||||
!task_fits_max(p, env->dst_cpu))
|
||||
return 0;
|
||||
|
||||
/* Don't allow boosted tasks to be pulled to small cores */
|
||||
if (env->flags & LBF_IGNORE_STUNE_BOOSTED_TASKS &&
|
||||
(schedtune_task_boost(p) > 0))
|
||||
return 0;
|
||||
|
||||
if (task_running(env->src_rq, p)) {
|
||||
schedstat_inc(p->se.statistics.nr_failed_migrations_running);
|
||||
return 0;
|
||||
@ -9677,6 +9683,9 @@ static int detach_tasks(struct lb_env *env)
|
||||
if (cpu_capacity(env->dst_cpu) < cpu_capacity(env->src_cpu))
|
||||
env->flags |= LBF_IGNORE_BIG_TASKS;
|
||||
|
||||
if (is_min_capacity_cpu(env->dst_cpu) && !is_min_capacity_cpu(env->src_cpu))
|
||||
env->flags |= LBF_IGNORE_STUNE_BOOSTED_TASKS;
|
||||
|
||||
redo:
|
||||
while (!list_empty(tasks)) {
|
||||
/*
|
||||
@ -9765,10 +9774,12 @@ next:
|
||||
}
|
||||
|
||||
if (env->flags & (LBF_IGNORE_BIG_TASKS |
|
||||
LBF_IGNORE_PREFERRED_CLUSTER_TASKS) && !detached) {
|
||||
LBF_IGNORE_PREFERRED_CLUSTER_TASKS |
|
||||
LBF_IGNORE_STUNE_BOOSTED_TASKS) && !detached) {
|
||||
tasks = &env->src_rq->cfs_tasks;
|
||||
env->flags &= ~(LBF_IGNORE_BIG_TASKS |
|
||||
LBF_IGNORE_PREFERRED_CLUSTER_TASKS);
|
||||
LBF_IGNORE_PREFERRED_CLUSTER_TASKS |
|
||||
LBF_IGNORE_STUNE_BOOSTED_TASKS);
|
||||
env->loop = orig_loop;
|
||||
goto redo;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user