[COMMON] sched: ems: Fix bug of ontime_task_wakeup
authorDaeyeong Lee <daeyeong.lee@samsung.com>
Tue, 27 Mar 2018 08:25:24 +0000 (17:25 +0900)
committerChungwoo Park <cww.park@samsung.com>
Mon, 21 May 2018 08:33:06 +0000 (17:33 +0900)
Despite not finding target_cpu, there was a hole to include the task in ontime.
The code to defenc it is added.

Change-Id: Ibf6aec93eedd2d7f8c9f45e2e4acc26705733838
Signed-off-by: Daeyeong Lee <daeyeong.lee@samsung.com>
kernel/sched/ehmp.c

index 65ea1d745382f8fc8a95659d001d579c81bf58e6..52f30b2b13cf45060c40da952a7c165f6ea2f9d0 100644 (file)
@@ -1435,6 +1435,10 @@ static int ontime_task_wakeup(struct task_struct *p)
        u64 delta;
        int target_cpu = -1;
 
+       /* When wakeup task is on ontime migrating, do not ontime wakeup */
+       if (ontime_flag(p) == ONTIME_MIGRATING)
+               return -1;
+
        /*
         * When wakeup task satisfies ontime condition to up migration,
         * check there is a possible target cpu.
@@ -1495,6 +1499,9 @@ static int ontime_task_wakeup(struct task_struct *p)
                goto ontime_out;
        }
 
+       if (!cpu_selected(target_cpu))
+               goto ontime_out;
+
 ontime_up:
        include_ontime_task(p, target_cpu);