[COMMON] sched: fair: ontime task must wake up from specified target_cpu
authorDaeyeong Lee <daeyeong.lee@samsung.com>
Tue, 13 Mar 2018 09:43:31 +0000 (18:43 +0900)
committerChungwoo Park <cww.park@samsung.com>
Mon, 21 May 2018 08:33:04 +0000 (17:33 +0900)
Change-Id: I49b6cbe6d77b1a4887d50dc0c65206cccaf51f71
Signed-off-by: Daeyeong Lee <daeyeong.lee@samsung.com>
include/linux/sched.h
kernel/sched/ehmp.c
kernel/sched/fair.c

index 7d60db84e0fbc9b61eb650fd014e4011ac4e85f7..8542337f11d183cb017bc6ca28dbffbf337ee181 100644 (file)
@@ -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;
index 7b53da91c6d6b9d578826e4ddc0e2215cac5a218..65ea1d745382f8fc8a95659d001d579c81bf58e6 100644 (file)
@@ -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)
index 3ade75011db4bc8a40c3128f151f0f6f917a4f9f..d7a44420aa6e400e74f8f2f4280bd9f998845adc 100644 (file)
@@ -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,