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

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

sched: don't assume higher capacity means higher power in tick migration



When an upmigrate ineligible task running on the maximum capacity CPU,
we check if it can be migrated to a lower capacity CPU in tick path.
Add a power cost based check there to prevent the task migration
from a power efficient CPU.

Change-Id: I291c62d7dbf169d5123faba5f5246ad44a7a40dd
Signed-off-by: default avatarPavankumar Kondeti <pkondeti@codeaurora.org>
parent 52296641
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -11380,8 +11380,15 @@ static inline int migration_needed(struct task_struct *p, int cpu)
	nice = task_nice(p);
	rcu_read_lock();
	grp = task_related_thread_group(p);
	/*
	 * Don't assume higher capacity means higher power. If the task
	 * is running on the power efficient CPU, avoid migrating it
	 * to a lower capacity cluster.
	 */
	if (!grp && (nice > SCHED_UPMIGRATE_MIN_NICE ||
	       upmigrate_discouraged(p)) && cpu_capacity(cpu) > min_capacity) {
			upmigrate_discouraged(p)) &&
			cpu_capacity(cpu) > min_capacity &&
			cpu_max_power_cost(cpu) == max_power_cost) {
		rcu_read_unlock();
		return DOWN_MIGRATION;
	}
+6 −0
Original line number Diff line number Diff line
@@ -454,6 +454,12 @@ compare_clusters(void *priv, struct list_head *a, struct list_head *b)
	cluster1 = container_of(a, struct sched_cluster, list);
	cluster2 = container_of(b, struct sched_cluster, list);

	/*
	 * Don't assume higher capacity means higher power. If the
	 * power cost is same, sort the higher capacity cluster before
	 * the lower capacity cluster to start placing the tasks
	 * on the higher capacity cluster.
	 */
	ret = cluster1->max_power_cost > cluster2->max_power_cost ||
		(cluster1->max_power_cost == cluster2->max_power_cost &&
		cluster1->max_possible_capacity <