[COMMON] sched: ems: Consider sync cpu when ontime task wakeup
authorDaeyeong Lee <daeyeong.lee@samsung.com>
Mon, 20 Aug 2018 07:03:26 +0000 (16:03 +0900)
committerhskang <hs1218.kang@samsung.com>
Sun, 9 Sep 2018 21:36:41 +0000 (06:36 +0900)
Change-Id: Ia77686fd9341ec427643c95bf82b1366a6303807
Signed-off-by: Daeyeong Lee <daeyeong.lee@samsung.com>
kernel/sched/ems/core.c
kernel/sched/ems/ems.h
kernel/sched/ems/ontime.c

index 6876795ff6b242923e9b6c021c19b4916b20a779..5e48067f9e64bed68dddf09ee5aff9764efa700f 100644 (file)
@@ -212,7 +212,7 @@ int exynos_wakeup_balance(struct task_struct *p, int prev_cpu, int sd_flag, int
         * Ontime task is very sensitive to performance because it is usually the
         * main task of application. Therefore, it has the highest priority.
         */
-       target_cpu = ontime_task_wakeup(p);
+       target_cpu = ontime_task_wakeup(p, sync);
        if (cpu_selected(target_cpu)) {
                strcpy(state, "ontime migration");
                goto out;
index fa9ee36b71a8a24e99d46ccc47d7ca89d3a297c8..29f50069eeaaea00827f7e440aab1acad832a5bb 100644 (file)
@@ -18,7 +18,7 @@
 
 extern struct kobject *ems_kobj;
 
-extern int ontime_task_wakeup(struct task_struct *p);
+extern int ontime_task_wakeup(struct task_struct *p, int sync);
 extern int select_perf_cpu(struct task_struct *p);
 extern int global_boosting(struct task_struct *p);
 extern int global_boosted(void);
index 2ea4cd3124954e647934bd4d696ea3516cbbb00f..9abba020e6fddf7afbd580fdc061438e903fdb36 100644 (file)
@@ -523,7 +523,7 @@ void ontime_migration(void)
        spin_unlock(&om_lock);
 }
 
-int ontime_task_wakeup(struct task_struct *p)
+int ontime_task_wakeup(struct task_struct *p, int sync)
 {
        struct cpumask fit_cpus;
        int dst_cpu, src_cpu = task_cpu(p);
@@ -540,6 +540,17 @@ int ontime_task_wakeup(struct task_struct *p)
        if (cpumask_test_cpu(MIN_CAPACITY_CPU, &fit_cpus))
                return -1;
 
+       /* If this cpu is fit and sync, wake up on this cpu */
+       if (sysctl_sched_sync_hint_enable && sync) {
+               int cpu = smp_processor_id();
+
+               if (cpumask_test_cpu(cpu, &p->cpus_allowed)
+                               && cpumask_test_cpu(cpu, &fit_cpus)) {
+                       trace_ems_ontime_task_wakeup(p, src_cpu, cpu, "ontime-sync wakeup");
+                       return cpu;
+               }
+       }
+
        dst_cpu = ontime_select_target_cpu(p, &fit_cpus);
        if (cpu_selected(dst_cpu)) {
                trace_ems_ontime_task_wakeup(p, src_cpu, dst_cpu, "ontime wakeup");