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

Commit 1e586743 authored by Patrick Bellasi's avatar Patrick Bellasi Committed by Todd Kjos
Browse files

sched/fair: enforce EAS mode



For non latency sensitive tasks the goal is to optimize for energy efficiency.
Thus, we should try our best to avoid moving a task on a CPU which is then
going to be marked as overutilized.

Let's use the capacity_margin metric to verify if a candidate target CPU
should be considered without risking to bail out of EAS mode.

Change-Id: Ib3697106f4073aedf4a6c6ce42bd5d000fa8c007
Signed-off-by: default avatarPatrick Bellasi <patrick.bellasi@arm.com>
Signed-off-by: default avatarChris Redpath <chris.redpath@arm.com>
(cherry picked from commit f95753da4ba7e1c1eee0500ffe41b3e5fa68b347)
Signed-off-by: default avatarQuentin Perret <quentin.perret@arm.com>
parent 78ff98b3
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -6862,6 +6862,19 @@ static inline int find_best_target(struct task_struct *p, int *backup_cpu,
				continue;
			}

			/*
			 * Enforce EAS mode
			 *
			 * For non latency sensitive tasks, skip CPUs that
			 * will be overutilized by moving the task there.
			 *
			 * The goal here is to remain in EAS mode as long as
			 * possible at least for !prefer_idle tasks.
			 */
			if ((new_util * capacity_margin) >
			    (capacity_orig * SCHED_CAPACITY_SCALE))
				continue;

			/*
			 * Case B) Non latency sensitive tasks on IDLE CPUs.
			 *