sched/fair: refine some scheduler changes from AU drop

Refine some changes from AU90. One is to allow boosted task run on min
capacity cpu if it fits in. The other is to check fast exit for
prefer-idle task first.

Bug: 128477368
Bug: 130576120
Test: task rq selection behavior is as expected

Change-Id: Ied57b37a361ed137d10167f0346f52a149d08cd6
Signed-off-by: Rick Yiu <rickyiu@google.com>
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
fourteen
Rick Yiu 6 years ago committed by Jenna
parent e9a8ce9047
commit fdbf09dfc1
  1. 19
      kernel/sched/fair.c

@ -7372,8 +7372,7 @@ static inline bool task_fits_max(struct task_struct *p, int cpu)
if (is_min_capacity_cpu(cpu)) { if (is_min_capacity_cpu(cpu)) {
if (task_boost_policy(p) == SCHED_BOOST_ON_BIG || if (task_boost_policy(p) == SCHED_BOOST_ON_BIG ||
task_boost > 0 || task_boost > 0)
schedtune_task_boost(p) > 0)
return false; return false;
} else { /* mid cap cpu */ } else { /* mid cap cpu */
if (task_boost > 1) if (task_boost > 1)
@ -7891,6 +7890,14 @@ static inline int find_best_target(struct task_struct *p, int *backup_cpu,
} while (sg = sg->next, sg != sd->groups); } while (sg = sg->next, sg != sd->groups);
if (prefer_idle && (best_idle_cpu != -1)) {
trace_sched_find_best_target(p, prefer_idle, min_util, cpu,
best_idle_cpu, best_active_cpu,
-1, best_idle_cpu, -1);
return best_idle_cpu;
}
if (best_idle_cpu != -1 && !is_packing_eligible(p, target_cpu, fbt_env, if (best_idle_cpu != -1 && !is_packing_eligible(p, target_cpu, fbt_env,
active_cpus_count, best_idle_cstate, active_cpus_count, best_idle_cstate,
boosted)) { boosted)) {
@ -7919,14 +7926,6 @@ static inline int find_best_target(struct task_struct *p, int *backup_cpu,
* b) IDLE CPU: best_idle_cpu * b) IDLE CPU: best_idle_cpu
*/ */
if (prefer_idle && (best_idle_cpu != -1)) {
trace_sched_find_best_target(p, prefer_idle, min_util, cpu,
best_idle_cpu, best_active_cpu,
-1, best_idle_cpu, -1);
return best_idle_cpu;
}
if (target_cpu == -1) if (target_cpu == -1)
target_cpu = prefer_idle target_cpu = prefer_idle
? best_active_cpu ? best_active_cpu

Loading…
Cancel
Save