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

Commit c84ba41c authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "sched: Avoid placing task on isolated prev_cpu"

parents 68291412 ef13e1ef
Loading
Loading
Loading
Loading
+13 −3
Original line number Diff line number Diff line
@@ -6929,6 +6929,7 @@ static inline int find_best_target(struct task_struct *p, int *backup_cpu,
	int target_cpu = -1;
	int cpu, i;
	unsigned int active_cpus_count = 0;
	int isolated_candidate = -1;

	*backup_cpu = -1;

@@ -6974,13 +6975,16 @@ static inline int find_best_target(struct task_struct *p, int *backup_cpu,
			unsigned long wake_util, new_util, min_capped_util;

			cpumask_clear_cpu(i, &search_cpus);
			if (avoid_prev_cpu && i == task_cpu(p))

			if (!cpu_online(i) || cpu_isolated(i))
				continue;

			if (!cpu_online(i) || cpu_isolated(i) || is_reserved(i))
			isolated_candidate = i;

			if (avoid_prev_cpu && i == task_cpu(p))
				continue;

			if (walt_cpu_high_irqload(i))
			if (walt_cpu_high_irqload(i) || is_reserved(i))
				continue;

			trace_sched_cpu_util(i);
@@ -7266,6 +7270,12 @@ static inline int find_best_target(struct task_struct *p, int *backup_cpu,
		? best_active_cpu
		: best_idle_cpu;

	if (target_cpu == -1 && cpu_isolated(task_cpu(p)) &&
			isolated_candidate != -1) {
		target_cpu = isolated_candidate;
		fbt_env->avoid_prev_cpu = true;
	}

	trace_sched_find_best_target(p, prefer_idle, min_util, cpu,
				     best_idle_cpu, best_active_cpu,
				     target_cpu);