From 72fa561b0dfd807f1f69ffd6a6f63cdf38a5d000 Mon Sep 17 00:00:00 2001 From: Olav Haugan Date: Mon, 24 Nov 2014 16:27:20 -0800 Subject: sched: Only do EA migration when CPU throttling is imminent We do not want to migrate tasks unnecessary to avoid cache hit and other migration latencies that could affect the performance of the system. Add a check to only try EA migration when CPU frequency throttling is imminent. CRs-Fixed: 764788 Change-Id: I92e86e62da10ce15f1e76a980df3545e93d76348 Signed-off-by: Olav Haugan [rameezmustafa@codeaurora.org]: Port to msm-3.18] Signed-off-by: Syed Rameez Mustafa nr_big_tasks; } +static inline int is_cpu_throttling_imminent(int cpu) +{ + int throttling = 0; + struct cpu_pwr_stats *per_cpu_info = get_cpu_pwr_stats(); + + if (per_cpu_info) + throttling = per_cpu_info[cpu].throttling; + return throttling; +} + #else /* CONFIG_SCHED_HMP */ #define sched_enable_power_aware 0 @@ -3774,6 +3787,11 @@ static inline int nr_big_tasks(struct rq *rq) return 0; } +static inline int is_cpu_throttling_imminent(int cpu) +{ + return 0; +} + #endif /* CONFIG_SCHED_HMP */ #ifdef CONFIG_SCHED_HMP @@ -7745,7 +7763,8 @@ group_type group_classify(struct sched_group *group, if ((capacity(env->dst_rq) == group_rq_capacity(group)) && sgs->sum_nr_running && (env->idle != CPU_NOT_IDLE) && power_cost_at_freq(env->dst_cpu, 0) < - power_cost_at_freq(cpumask_first(sched_group_cpus(group)), 0)) { + power_cost_at_freq(cpumask_first(sched_group_cpus(group)), 0) && + is_cpu_throttling_imminent(cpumask_first(sched_group_cpus(group)))) { env->flags |= LBF_PWR_ACTIVE_BALANCE; return group_ea; } -- cgit v1.2.3