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

Commit 36d4ec70 authored by Satya Durga Srinivasu Prabhala's avatar Satya Durga Srinivasu Prabhala
Browse files

sched: Do not support colocation on cluster with one CPU



Add check to make sure we do not colocate tasks to cluster
which has only one CPU. If tasks in a group should migrate,
tasks shouldn't migrate to cluster with only one CPU as CPU
won't be able to handle all the tasks in the group.

Change-Id: I01fdc9cf625eeaa01e2c4f137edb21e8610d41c1
Signed-off-by: default avatarSatya Durga Srinivasu Prabhala <satyap@codeaurora.org>
parent 456c150f
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -2420,13 +2420,18 @@ static struct sched_cluster *best_cluster(struct related_thread_group *grp,
					u64 total_demand, bool group_boost)
{
	struct sched_cluster *cluster = NULL;
	struct sched_cluster *last_best_cluster = sched_cluster[0];

	for_each_sched_cluster(cluster) {
		if (cpumask_weight(&cluster->cpus) <= 1)
			continue;

		last_best_cluster = cluster;
		if (group_will_fit(cluster, grp, total_demand, group_boost))
			return cluster;
			break;
	}

	return sched_cluster[0];
	return last_best_cluster;
}

int preferred_cluster(struct sched_cluster *cluster, struct task_struct *p)