Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c47c3c9e authored by Pavankumar Kondeti's avatar Pavankumar Kondeti Committed by Gerrit - the friendly Code Review server
Browse files

sched/fair: Improve the scheduler



This change is for general scheduler improvement.

Change-Id: I15c01c20691899053e0aa760923ba0db644f2b73
Signed-off-by: default avatarPavankumar Kondeti <pkondeti@codeaurora.org>
[satyap@codeaurora.org: port to 5.4 and resolve trivial merge conflicts]
Signed-off-by: default avatarSatya Durga Srinivasu Prabhala <satyap@codeaurora.org>
parent 692aa6b9
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -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 @@ int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu,
	    (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);