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

Commit 068743c1 authored by Pavankumar Kondeti's avatar Pavankumar Kondeti Committed by Gerrit - the friendly Code Review server
Browse files

sched: don't select an inactive/isolated CPU in sbc()



In select_best_cpu(), if no CPU is selected from the candidate
cluster, the search is expanded to the backup cluster. The
current code may select an inactive/isolated CPU in the
backup cluster. Fix this.

Change-Id: Id1e8a2b2f84ea274cdeda408957490ca05ef5fdb
Signed-off-by: default avatarPavankumar Kondeti <pkondeti@codeaurora.org>
parent b1bfa78b
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -10768,11 +10768,18 @@ struct cpu_select_env *env, struct cluster_cpu_stats *stats)
{
	struct sched_cluster *next = NULL;
	int i;
	struct cpumask search_cpus;

	while (!bitmap_empty(env->backup_list, num_clusters)) {
		next = next_candidate(env->backup_list, 0, num_clusters);
		__clear_bit(next->id, env->backup_list);
		for_each_cpu_and(i, &env->p->cpus_allowed, &next->cpus) {

		cpumask_and(&search_cpus, tsk_cpus_allowed(env->p),
						&next->cpus);
		cpumask_and(&search_cpus, &search_cpus, cpu_active_mask);
		cpumask_andnot(&search_cpus, &search_cpus, cpu_isolated_mask);

		for_each_cpu(i, &search_cpus) {
			trace_sched_cpu_load_wakeup(cpu_rq(i), idle_cpu(i),
			sched_irqload(i), power_cost(i, task_load(env->p) +
					cpu_cravg_sync(i, env->sync)), 0);