diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 78ebc6ec401f..29a5903ce891 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -2231,7 +2231,13 @@ static inline unsigned long task_util(struct task_struct *p) * * Return: the (estimated) utilization for the specified CPU */ + +#ifdef CONFIG_SCHED_WALT static inline unsigned long cpu_util(int cpu) +#else +static inline unsigned long cpu_util(int cpu); +static inline unsigned long __cpu_util(int cpu) +#endif { struct cfs_rq *cfs_rq; unsigned int util; @@ -2741,8 +2747,23 @@ static inline unsigned long schedutil_cpu_util(int cpu, unsigned long util_cfs, { return 0; } + +static inline unsigned long cpu_util_rt(struct rq *rq) +{ + return 0; +} #endif /* CONFIG_CPU_FREQ_GOV_SCHEDUTIL */ +#ifdef CONFIG_SMP +#ifndef CONFIG_SCHED_WALT +static inline unsigned long cpu_util(int cpu) +{ + return min(__cpu_util(cpu) + cpu_util_rt(cpu_rq(cpu)), + capacity_orig_of(cpu)); +} +#endif +#endif + #ifdef CONFIG_HAVE_SCHED_AVG_IRQ static inline unsigned long cpu_util_irq(struct rq *rq) {