get_cpu_usage is useful to a cpu frequency scaling policy which is based on CFS load tracking and cpu capacity metrics. Expose these calls in sched.h so that they can be used in such a policy.
Signed-off-by: Michael Turquette mturquette@linaro.org --- kernel/sched/fair.c | 2 +- kernel/sched/sched.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 75aec8d..b066a61 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4801,7 +4801,7 @@ done: * Without capping the usage, a group could be seen as overloaded (CPU0 usage * at 121% + CPU1 usage at 80%) whereas CPU1 has 20% of available capacity */ -static int get_cpu_usage(int cpu) +int get_cpu_usage(int cpu) { unsigned long usage = cpu_rq(cpu)->cfs.utilization_load_avg; unsigned long capacity = capacity_orig_of(cpu); diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 91c6736..0fe57ba 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -1396,6 +1396,8 @@ unsigned long arch_scale_freq_capacity(struct sched_domain *sd, int cpu) } #endif
+int get_cpu_usage(int cpu); + static inline void sched_rt_avg_update(struct rq *rq, u64 rt_delta) { rq->rt_avg += rt_delta * arch_scale_freq_capacity(NULL, cpu_of(rq)); -- 1.9.1