From e592429d76fb236f7b7a710d1eb0cddedcb3f684 Mon Sep 17 00:00:00 2001 From: Park Bumgyu Date: Tue, 12 Jun 2018 15:12:22 +0900 Subject: [PATCH] sched: ems: add function to get cpu mips. Change-Id: I79918451a93bddf1effe7d8ed6a65a0176886012 Signed-off-by: Park Bumgyu --- kernel/sched/ems/ems.h | 1 + kernel/sched/ems/energy.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/kernel/sched/ems/ems.h b/kernel/sched/ems/ems.h index 1ca906233d5f..41f83a66dc0c 100644 --- a/kernel/sched/ems/ems.h +++ b/kernel/sched/ems/ems.h @@ -38,3 +38,4 @@ static inline int group_balancing(struct task_struct *p) { return -1; } extern int 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 inline unsigned int get_cpu_mips(unsigned int cpu); diff --git a/kernel/sched/ems/energy.c b/kernel/sched/ems/energy.c index de31fe908d59..12d59e25e253 100644 --- a/kernel/sched/ems/energy.c +++ b/kernel/sched/ems/energy.c @@ -35,6 +35,11 @@ struct energy_table { }; DEFINE_PER_CPU(struct energy_table, energy_table); +inline unsigned int get_cpu_mips(unsigned int cpu) +{ + return per_cpu(energy_table, cpu).mips; +} + /* * When choosing cpu considering energy efficiency, decide best cpu and * backup cpu according to policy, and then choose cpu which consumes the -- 2.20.1