From 89fd2a3044c8e555dfaae872d342a4e241b2d10b Mon Sep 17 00:00:00 2001 From: Sangkyu Kim Date: Mon, 8 Oct 2018 20:18:04 +0900 Subject: [PATCH] ems: frt: sync for latest Change-Id: I6bfc7af78625019ad1e81823e257c11f4a124e11 Signed-off-by: Sangkyu Kim --- kernel/sched/rt.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index f82a43b7d914..2cbb8daae825 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -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; -- 2.20.1