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

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

Merge "sched: Improve the scheduler"

parents b83d4310 d3af3450
Loading
Loading
Loading
Loading
+5 −8
Original line number Diff line number Diff line
@@ -6743,7 +6743,6 @@ static void find_best_target(struct sched_domain *sd, cpumask_t *cpus,
	unsigned long target_capacity = ULONG_MAX;
	unsigned long min_wake_util = ULONG_MAX;
	unsigned long target_max_spare_cap = 0;
	unsigned long target_util = ULONG_MAX;
	unsigned long best_active_util = ULONG_MAX;
	unsigned long best_active_cuml_util = ULONG_MAX;
	unsigned long best_idle_cuml_util = ULONG_MAX;
@@ -6837,7 +6836,7 @@ static void find_best_target(struct sched_domain *sd, cpumask_t *cpus,
			 */
			wake_util = cpu_util_without(i, p);
			new_util = wake_util + task_util_est(p);
			spare_wake_cap = capacity_orig_of(i) - wake_util;
			spare_wake_cap = capacity_orig - wake_util;

			if (spare_wake_cap > most_spare_wake_cap) {
				most_spare_wake_cap = spare_wake_cap;
@@ -7009,17 +7008,16 @@ static void find_best_target(struct sched_domain *sd, cpumask_t *cpus,
			 */
			if (idle_cpu(i)) {
				/*
				 * Skip CPUs in deeper idle state, but only
				 * if they are also less energy efficient.
				 * IOW, prefer a deep IDLE LITTLE CPU vs a
				 * shallow idle big CPU.
				 * Prefer shallowest over deeper idle state cpu,
				 * of same capacity cpus.
				 */
				if (capacity_orig >= target_capacity &&
				if (capacity_orig == target_capacity &&
				    sysctl_sched_cstate_aware &&
				    idle_idx > shallowest_idle_cstate)
					continue;

				if (shallowest_idle_cstate == idle_idx &&
					target_capacity == capacity_orig &&
					(best_idle_cpu == prev_cpu ||
					(i != prev_cpu &&
					new_util_cuml > best_idle_cuml_util)))
@@ -7064,7 +7062,6 @@ static void find_best_target(struct sched_domain *sd, cpumask_t *cpus,

			target_max_spare_cap = spare_cap;
			target_capacity = capacity_orig;
			target_util = new_util;
			target_cpu = i;
		}