sched/fair: Improve the scheduler

This change is for general scheduler improvement.

Change-Id: I15c01c20691899053e0aa760923ba0db644f2b73
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
[satyap@codeaurora.org: port to 5.4 and resolve trivial merge conflicts]
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
This commit is contained in:
Pavankumar Kondeti 2019-08-21 13:26:16 +05:30 • committed by Gerrit - the friendly Code Review server
commit c47c3c9ed1

View file

@ -3817,7 +3817,7 @@ util_est_dequeue(struct cfs_rq *cfs_rq, struct task_struct *p, bool task_sleep)
}
static inline bool
bias_to_waker_cpu(struct task_struct *p, int cpu, int start_cpu)
bias_to_this_cpu(struct task_struct *p, int cpu, int start_cpu)
{
bool base_test = cpumask_test_cpu(cpu, &p->cpus_mask) &&
cpu_active(cpu);
@ -6430,6 +6430,7 @@ enum fastpaths {
NONE = 0,
SYNC_WAKEUP,
PREV_CPU_FASTPATH,
MANY_WAKEUP,
};
static void find_best_target(struct sched_domain *sd, cpumask_t *cpus,
@ -7029,10 +7030,17 @@ int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu,
if (need_idle)
sync = 0;
if (sync && bias_to_waker_cpu(p, cpu, start_cpu)) {
if (sync && bias_to_this_cpu(p, cpu, start_cpu)) {
best_energy_cpu = cpu;
fbt_env.fastpath = SYNC_WAKEUP;
goto sync_wakeup;
goto done;
}
if (is_many_wakeup(sibling_count_hint) && prev_cpu != cpu &&
bias_to_this_cpu(p, prev_cpu, start_cpu)) {
best_energy_cpu = prev_cpu;
fbt_env.fastpath = MANY_WAKEUP;
goto done;
}
rcu_read_lock();
@ -7214,7 +7222,7 @@ unlock:
(capacity_orig_of(prev_cpu) <= capacity_orig_of(start_cpu)))
best_energy_cpu = prev_cpu;
sync_wakeup:
done:
trace_sched_task_util(p, cpumask_bits(candidates)[0], best_energy_cpu,
sync, need_idle, fbt_env.fastpath, placement_boost,
start_t, boosted, is_rtg, get_rtg_status(p), start_cpu);