diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 135be535a4ef..f17279e4dc36 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5104,6 +5104,17 @@ static void record_wakee(struct task_struct *p) } } +/* + * Returns the current capacity of cpu after applying both + * cpu and freq scaling. + */ +static unsigned long capacity_curr_of(int cpu) +{ + return cpu_rq(cpu)->cpu_capacity_orig * + arch_scale_freq_capacity(NULL, cpu) + >> SCHED_CAPACITY_SHIFT; +} + static inline bool energy_aware(void) { return sched_feat(ENERGY_AWARE);