diff options
| author | Patrick Bellasi <patrick.bellasi@arm.com> | 2017-07-17 15:54:39 +0100 |
|---|---|---|
| committer | Chris Redpath <chris.redpath@arm.com> | 2017-10-27 13:30:33 +0100 |
| commit | ca42e804464bc9cb81e2ad07fe689c9f8514d5fe (patch) | |
| tree | bbc9570b66470d018075d3093b41962b9b2955a7 /kernel | |
| parent | 4edc5b0e387a906a00cb45af2abf76aa3a930438 (diff) | |
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: Patrick Bellasi <patrick.bellasi@arm.com>
Signed-off-by: Chris Redpath <chris.redpath@arm.com>
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/sched/fair.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 417b373e4074..0784864eeb30 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6470,6 +6470,19 @@ static inline int find_best_target(struct task_struct *p, int *backup_cpu, } /* + * 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. * * Find an optimal backup IDLE CPU for non latency |
