ems: frt: sync for latest
authorSangkyu Kim <skwith.kim@samsung.com>
Mon, 8 Oct 2018 11:18:04 +0000 (20:18 +0900)
committerhskang <hs1218.kang@samsung.com>
Wed, 10 Oct 2018 12:59:59 +0000 (21:59 +0900)
Change-Id: I6bfc7af78625019ad1e81823e257c11f4a124e11
Signed-off-by: Sangkyu Kim <skwith.kim@samsung.com>
kernel/sched/rt.c

index f82a43b7d9146f7cc0fd25206a933101c87c729d..2cbb8daae825b1a160eb651252fc8f64eff74db0 100644 (file)
@@ -2678,8 +2678,8 @@ static int find_idle_cpu(struct task_struct *task, int wake_flags)
        if (unlikely(!dom))
                return best_cpu;
 
-       cpumask_and(&candidate_cpus, &task->cpus_allowed, cpu_active_mask);
        cpumask_and(&candidate_cpus, &candidate_cpus, get_activated_cpus());
+       cpumask_and(&candidate_cpus, &task->cpus_allowed, cpu_active_mask);
        if (unlikely(cpumask_empty(&candidate_cpus)))
                cpumask_copy(&candidate_cpus, &task->cpus_allowed);
 
@@ -2692,6 +2692,9 @@ static int find_idle_cpu(struct task_struct *task, int wake_flags)
                                continue;
 
                        cpu_load = frt_cpu_util_wake(cpu, task) + task_util(task);
+                       if (cpu_load > capacity_orig_of(cpu))
+                               continue;
+
                        if ((cpu_prio > max_prio) || (cpu_load < min_load) ||
                                        (cpu_load == min_load && task_cpu(task) == cpu)) {
                                min_load = cpu_load;
@@ -2717,8 +2720,8 @@ static int find_idle_cpu(struct task_struct *task, int wake_flags)
 static int find_recessive_cpu(struct task_struct *task, int wake_flags)
 {
        int cpu, best_cpu = -1;
+       u64 cpu_load, min_load = ULLONG_MAX;
        struct cpumask *lowest_mask;
-       u64 cpu_load = ULLONG_MAX, min_load = ULLONG_MAX;
        struct cpumask candidate_cpus;
        struct frt_dom *dom, *prefer_dom;
 
@@ -2742,6 +2745,9 @@ static int find_recessive_cpu(struct task_struct *task, int wake_flags)
                for_each_cpu_and(cpu, &dom->cpus, &candidate_cpus) {
                        cpu_load = frt_cpu_util_wake(cpu, task) + task_util(task);
 
+                       if (cpu_load > capacity_orig_of(cpu))
+                               continue;
+
                        if (cpu_load < min_load ||
                                (cpu_load == min_load && task_cpu(task) == cpu)) {
                                min_load = cpu_load;