diff options
author | Chris Redpath <chris.redpath@arm.com> | 2015-02-04 14:55:19 +0900 |
---|---|---|
committer | Seung-Woo Kim <sw0312.kim@samsung.com> | 2016-12-14 13:41:58 +0900 |
commit | 45c8b3e79d75311e81b80cf4aeb4c96a4480b23c (patch) | |
tree | 3597a8abfd70361c2b6a43cc29b808cc8d57c8ba /kernel | |
parent | f2ea79fb72c1a0b7ccdb09eb05715e2befa4eeba (diff) |
hmp: sched: Clean up hmp_up_threshold checks into a utility fn
In anticipation of modifying the up_threshold handling, make all
instances use the same utility fn to check if a task is eligible
for up-migration. This also removes the previous difference in
threshold comparison where up-migration used '!<threshold' and
idle pull used '>threshold' to decide up-migration eligibility.
Make them both use '!<threshold' instead for consistency, although
this is unlikely to change any results.
Signed-off-by: Chris Redpath <chris.redpath@arm.com>
Signed-off-by: Jon Medhurst <tixy@linaro.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched/fair.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index d34aa933d646..1e213675ea5b 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -8779,6 +8779,14 @@ static void nohz_idle_balance(struct rq *this_rq, enum cpu_idle_type idle) { } #endif #ifdef CONFIG_SCHED_HMP +static unsigned int hmp_task_eligible_for_up_migration(struct sched_entity *se) +{ + /* below hmp_up_threshold, never eligible */ + if (se->avg.load_avg_ratio < hmp_up_threshold) + return 0; + return 1; +} + /* Check if task should migrate to a faster cpu */ static unsigned int hmp_up_migration(int cpu, int *target_cpu, struct sched_entity *se) { @@ -8794,7 +8802,7 @@ static unsigned int hmp_up_migration(int cpu, int *target_cpu, struct sched_enti if (p->prio >= hmp_up_prio) return 0; #endif - if (se->avg.load_avg_ratio < hmp_up_threshold) + if (!hmp_task_eligible_for_up_migration(se)) return 0; /* Let the task load settle before doing another up migration */ @@ -9284,7 +9292,10 @@ static unsigned int hmp_idle_pull(int this_cpu) } orig = curr; curr = hmp_get_heaviest_task(curr, 1); - if (curr->avg.load_avg_ratio > hmp_up_threshold && + /* check if heaviest eligible task on this + * CPU is heavier than previous task + */ + if (hmp_task_eligible_for_up_migration(curr) && curr->avg.load_avg_ratio > ratio) { p = task_of(curr); target = rq; |