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

Commit d1e22f18 authored by Pavankumar Kondeti's avatar Pavankumar Kondeti
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>
parent b70d759c
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -3871,7 +3871,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_allowed) &&
			cpu_active(cpu);
@@ -6878,6 +6878,7 @@ enum fastpaths {
	NONE = 0,
	SYNC_WAKEUP,
	PREV_CPU_FASTPATH,
	MANY_WAKEUP,
};

static void find_best_target(struct sched_domain *sd, cpumask_t *cpus,
@@ -7651,10 +7652,17 @@ static int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu,
		sync = 0;

	if (sysctl_sched_sync_hint_enable && sync &&
				bias_to_waker_cpu(p, cpu, start_cpu)) {
				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();
@@ -7750,7 +7758,7 @@ static int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu,
	    ((prev_energy - best_energy) <= prev_energy >> 4))
		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,