sched: ems: provide API for cpu max capacity
authorPark Bumgyu <bumgyu.park@samsung.com>
Tue, 19 Jun 2018 06:10:01 +0000 (15:10 +0900)
committerlakkyung.jung <lakkyung.jung@samsung.com>
Mon, 23 Jul 2018 05:59:44 +0000 (14:59 +0900)
Change-Id: Iaef589d777ce55ab21f642f4f9333d753309069e
Signed-off-by: Park Bumgyu <bumgyu.park@samsung.com>
kernel/sched/ems/ems.h
kernel/sched/ems/energy.c

index 1e95990946454b6d598287c42cfb9bed84bc6601..7a1b20438af3bf6f72d9b478833b6b70496671d5 100644 (file)
@@ -38,5 +38,6 @@ extern unsigned long task_util(struct task_struct *p);
 extern int cpu_util_wake(int cpu, struct task_struct *p);
 extern unsigned long task_util_est(struct task_struct *p);
 extern unsigned int get_cpu_mips(unsigned int cpu);
+extern unsigned int get_cpu_max_capacity(unsigned int cpu);
 
 extern unsigned long boosted_task_util(struct task_struct *p);
index 663dbe26c45e5fbc9d0af429f8bc981e70a430ee..03a22f424b2f071f51d17585b1b46d6f07591ad8 100644 (file)
@@ -41,6 +41,13 @@ inline unsigned int get_cpu_mips(unsigned int cpu)
        return per_cpu(energy_table, cpu).mips;
 }
 
+unsigned int get_cpu_max_capacity(unsigned int cpu)
+{
+       struct energy_table *table = &per_cpu(energy_table, cpu);
+
+       return table->states[table->nr_states - 1].cap;
+}
+
 /*
  * When choosing cpu considering energy efficiency, decide best cpu and
  * backup cpu according to policy, and then choose cpu which consumes the