From: Park Bumgyu Date: Tue, 19 Jun 2018 06:10:01 +0000 (+0900) Subject: sched: ems: provide API for cpu max capacity X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0529f2d4e3fcb5580a10f1e03e3679ff5156cadc;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git sched: ems: provide API for cpu max capacity Change-Id: Iaef589d777ce55ab21f642f4f9333d753309069e Signed-off-by: Park Bumgyu --- diff --git a/kernel/sched/ems/ems.h b/kernel/sched/ems/ems.h index 1e9599094645..7a1b20438af3 100644 --- a/kernel/sched/ems/ems.h +++ b/kernel/sched/ems/ems.h @@ -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); diff --git a/kernel/sched/ems/energy.c b/kernel/sched/ems/energy.c index 663dbe26c45e..03a22f424b2f 100644 --- a/kernel/sched/ems/energy.c +++ b/kernel/sched/ems/energy.c @@ -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