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

Commit c8928333 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 04d07a9b
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -5848,7 +5848,7 @@ static unsigned long __cpu_norm_util(unsigned long util, unsigned long capacity)
}

static inline bool
bias_to_waker_cpu(struct task_struct *p, int cpu, struct cpumask *rtg_target)
bias_to_this_cpu(struct task_struct *p, int cpu, struct cpumask *rtg_target)
{
	bool base_test = cpumask_test_cpu(cpu, &p->cpus_allowed) &&
			cpu_active(cpu) && task_fits_max(p, cpu);
@@ -7469,6 +7469,7 @@ enum fastpaths {
	NONE = 0,
	SYNC_WAKEUP,
	PREV_CPU_FASTPATH,
	MANY_WAKEUP,
};

static inline int find_best_target(struct task_struct *p, int *backup_cpu,
@@ -8181,12 +8182,19 @@ static int find_energy_efficient_cpu(struct sched_domain *sd,
		sync = 0;

	if (sysctl_sched_sync_hint_enable && sync &&
				bias_to_waker_cpu(p, cpu, rtg_target)) {
				bias_to_this_cpu(p, cpu, rtg_target)) {
		target_cpu = cpu;
		fbt_env.fastpath = SYNC_WAKEUP;
		goto out;
	}

	if (is_many_wakeup(sibling_count_hint) && prev_cpu != cpu &&
				bias_to_this_cpu(p, prev_cpu, rtg_target)) {
		target_cpu = prev_cpu;
		fbt_env.fastpath = MANY_WAKEUP;
		goto out;
	}

	/* prepopulate energy diff environment */
	eenv = get_eenv(p, prev_cpu);
	if (eenv->max_cpu_count < 2)