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

Commit 79fe7870 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "sched: Improve the scheduler"

parents b6508184 e3a0b52b
Loading
Loading
Loading
Loading
+17 −2
Original line number Diff line number Diff line
@@ -1830,6 +1830,7 @@ static int rt_energy_aware_wake_cpu(struct task_struct *task)
	int best_cpu_idle_idx = INT_MAX;
	int cpu_idle_idx = -1;
	bool boost_on_big = rt_boost_on_big();
	bool best_cpu_lt = true;

	rcu_read_lock();

@@ -1856,6 +1857,7 @@ static int rt_energy_aware_wake_cpu(struct task_struct *task)
		}

		for_each_cpu_and(cpu, lowest_mask, sched_group_span(sg)) {
			bool lt;

			trace_sched_cpu_util(cpu);

@@ -1870,8 +1872,20 @@ static int rt_energy_aware_wake_cpu(struct task_struct *task)

			util = cpu_util(cpu);

			/* Find the least loaded CPU */
			if (util > best_cpu_util)
			lt = (walt_low_latency_task(cpu_rq(cpu)->curr) ||
				walt_nr_rtg_high_prio(cpu));

			/*
			 * When the best is suitable and the current is not,
			 * skip it
			 */
			if (lt && !best_cpu_lt)
				continue;
			/*
			 * Either both are sutilable or unsuitable, load takes
			 * precedence.
			 */
			if (!(best_cpu_lt ^ lt) && (util > best_cpu_util))
				continue;

			/*
@@ -1905,6 +1919,7 @@ static int rt_energy_aware_wake_cpu(struct task_struct *task)
			best_cpu_util = util;
			best_cpu = cpu;
			best_capacity = capacity_orig;
			best_cpu_lt = lt;
		}

	} while (sg = sg->next, sg != sd->groups);