From 3aae75096aa88eb891889861d4a24430239b74a6 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 e6cdb453aeeb..08a0772bd9f9 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -2694,8 +2694,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); @@ -2708,6 +2708,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; @@ -2733,8 +2736,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; @@ -2758,6 +2761,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