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

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

Merge "sched: Avoid placing task on isolated prev_cpu"

parents 74da5aff 1117bade
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -7359,6 +7359,7 @@ static inline int find_best_target(struct task_struct *p, int *backup_cpu,
	unsigned int active_cpus_count = 0;
	int prev_cpu = task_cpu(p);
	bool next_group_higher_cap = false;
	int isolated_candidate = -1;

	*backup_cpu = -1;

@@ -7419,6 +7420,8 @@ static inline int find_best_target(struct task_struct *p, int *backup_cpu,
			if (!cpu_online(i) || cpu_isolated(i))
				continue;

			if (isolated_candidate == -1)
				isolated_candidate = i;
			/*
			 * This CPU is the target of an active migration that's
			 * yet to complete. Avoid placing another task on it.
@@ -7777,6 +7780,11 @@ static inline int find_best_target(struct task_struct *p, int *backup_cpu,
		target_cpu = *backup_cpu;
		*backup_cpu = -1;
	}

	if (target_cpu == -1 && isolated_candidate != -1 &&
	    cpu_isolated(prev_cpu))
		target_cpu == isolated_candidate;

out:
	return target_cpu;
}