From 830b395301605d737c8d774306f5769d3bb25b80 Mon Sep 17 00:00:00 2001 From: Daeyeong Lee Date: Tue, 13 Mar 2018 18:43:31 +0900 Subject: [PATCH] [COMMON] sched: fair: ontime task must wake up from specified target_cpu Change-Id: I49b6cbe6d77b1a4887d50dc0c65206cccaf51f71 Signed-off-by: Daeyeong Lee --- include/linux/sched.h | 2 ++ kernel/sched/ehmp.c | 1 - kernel/sched/fair.c | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/linux/sched.h b/include/linux/sched.h index 7d60db84e0fb..8542337f11d1 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -352,6 +352,8 @@ struct sched_avg { #define ONTIME_MIGRATING 2 #define ONTIME 4 +#define ontime_of(p) (&p->se.ontime) + struct ontime_avg { u64 ontime_migration_time; u64 load_sum; diff --git a/kernel/sched/ehmp.c b/kernel/sched/ehmp.c index 7b53da91c6d6..65ea1d745382 100644 --- a/kernel/sched/ehmp.c +++ b/kernel/sched/ehmp.c @@ -1088,7 +1088,6 @@ out: /****************************************************************/ #define TASK_TRACK_COUNT 5 -#define ontime_of(p) (&p->se.ontime) #define ontime_task_cpu(p) (ontime_of(p)->cpu) #define ontime_flag(p) (ontime_of(p)->flags) #define ontime_migration_time(p) (ontime_of(p)->avg.ontime_migration_time) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 3ade75011db4..d7a44420aa6e 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -7346,10 +7346,13 @@ static int find_energy_efficient_cpu(struct sched_domain *sd, eenv->max_cpu_count = EAS_CPU_BKP + 1; /* Find a cpu with sufficient capacity */ - if (sched_feat(EXYNOS_HMP)) + if (sched_feat(EXYNOS_HMP)) { eenv->cpu[EAS_CPU_NXT].cpu_id = exynos_select_cpu(p, &eenv->cpu[EAS_CPU_BKP].cpu_id, boosted, prefer_idle); + if (ontime_of(p)->flags == ONTIME) + return eenv->cpu[EAS_CPU_NXT].cpu_id; + } else eenv->cpu[EAS_CPU_NXT].cpu_id = find_best_target(p, &eenv->cpu[EAS_CPU_BKP].cpu_id, -- 2.20.1