[COMMON] sched: ems: Use get_cpu_max_capacity instead of get_cpu_mips
authorDaeyeong Lee <daeyeong.lee@samsung.com>
Mon, 3 Sep 2018 06:24:06 +0000 (15:24 +0900)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:24:57 +0000 (20:24 +0300)
Change-Id: I911e849159eaf4b8941b919e0dbe1b7024b98236
Signed-off-by: Daeyeong Lee <daeyeong.lee@samsung.com>
kernel/sched/ems/ontime.c

index 1547825de2644c1cbf9b28c18c9304a782c1e95f..273654e2547440d10985608b88cedcba186c94a0 100644 (file)
@@ -120,6 +120,14 @@ static unsigned long get_coverage_ratio(int cpu)
                return 0;
 }
 
+static bool is_faster_than(int src, int dst)
+{
+       if (get_cpu_max_capacity(src) < get_cpu_max_capacity(dst))
+               return true;
+       else
+               return false;
+}
+
 static int
 ontime_select_fit_cpus(struct task_struct *p, struct cpumask *fit_cpus)
 {
@@ -140,7 +148,7 @@ ontime_select_fit_cpus(struct task_struct *p, struct cpumask *fit_cpus)
                list_for_each_entry(curr, &cond_list, list) {
                        int dst_cpu = cpumask_first(&curr->cpus);
 
-                       if (get_cpu_mips(src_cpu) < get_cpu_mips(dst_cpu))
+                       if (is_faster_than(src_cpu, dst_cpu))
                                cpumask_or(fit_cpus, fit_cpus, &curr->cpus);
                }
        } else if (ontime_load_avg(p) >= curr->lower_boundary) {
@@ -531,7 +539,7 @@ void ontime_migration(void)
                 * If fit_cpus is smaller than current coregroup,
                 * don't need to ontime migration.
                 */
-               if (get_cpu_mips(cpu) >= get_cpu_mips(cpumask_first(&fit_cpus))) {
+               if (!is_faster_than(cpu, cpumask_first(&fit_cpus))) {
                        raw_spin_unlock_irqrestore(&rq->lock, flags);
                        continue;
                }
@@ -629,7 +637,7 @@ int ontime_can_migration(struct task_struct *p, int dst_cpu)
                return true;
        }
 
-       if (get_cpu_mips(dst_cpu) > get_cpu_mips(src_cpu)) {
+       if (is_faster_than(src_cpu, dst_cpu)) {
                trace_ems_ontime_check_migrate(p, dst_cpu, true, "go to bigger");
                return true;
        }