diff options
Diffstat (limited to 'kernel/sched')
-rw-r--r-- | kernel/sched/fair.c | 24 | ||||
-rw-r--r-- | kernel/sched/sched.h | 10 |
2 files changed, 17 insertions, 17 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 0058830c8f0b..928cbb03213c 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -2327,7 +2327,7 @@ static __always_inline int __update_entity_runnable_avg(u64 now, int cpu, u64 delta, scaled_delta, periods; u32 runnable_contrib, scaled_runnable_contrib; int delta_w, scaled_delta_w, decayed = 0; - unsigned long scale_freq = arch_scale_freq_capacity(NULL, cpu); + unsigned long scale_freq = arch_scale_freq_capacity(cpu); unsigned long scale_cpu = arch_scale_cpu_capacity(NULL, cpu); trace_sched_contrib_scale_f(cpu, scale_freq, scale_cpu); @@ -4238,6 +4238,17 @@ unsigned long capacity_orig_of(int cpu) return cpu_rq(cpu)->cpu_capacity_orig; } +/* + * Returns the current capacity of cpu after applying both + * cpu and freq scaling. + */ +unsigned long capacity_curr_of(int cpu) +{ + return cpu_rq(cpu)->cpu_capacity_orig * + arch_scale_freq_capacity(cpu) + >> SCHED_CAPACITY_SHIFT; +} + #ifdef CONFIG_SMP /* Used instead of source_load when we know the type == 0 */ static unsigned long weighted_cpuload(const int cpu) @@ -4452,17 +4463,6 @@ static long effective_load(struct task_group *tg, int cpu, long wl, long wg) #endif /* - * Returns the current capacity of cpu after applying both - * cpu and freq scaling. - */ -unsigned long capacity_curr_of(int cpu) -{ - return cpu_rq(cpu)->cpu_capacity_orig * - arch_scale_freq_capacity(NULL, cpu) - >> SCHED_CAPACITY_SHIFT; -} - -/* * get_cpu_usage returns the amount of capacity of a CPU that is used by CFS * tasks. The unit of the return value must be the one of capacity so we can * compare the usage with the capacity of the CPU that is available for CFS diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 0d43a7255eb7..216d5a897491 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -1382,17 +1382,17 @@ static inline int hrtick_enabled(struct rq *rq) #endif /* CONFIG_SCHED_HRTICK */ -#ifdef CONFIG_SMP -extern void sched_avg_update(struct rq *rq); - #ifndef arch_scale_freq_capacity static __always_inline -unsigned long arch_scale_freq_capacity(struct sched_domain *sd, int cpu) +unsigned long arch_scale_freq_capacity(int cpu) { return SCHED_CAPACITY_SCALE; } #endif +#ifdef CONFIG_SMP +extern void sched_avg_update(struct rq *rq); + #ifndef arch_scale_cpu_capacity static __always_inline unsigned long arch_scale_cpu_capacity(struct sched_domain *sd, int cpu) @@ -1408,7 +1408,7 @@ unsigned long capacity_orig_of(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)); + rq->rt_avg += rt_delta * arch_scale_freq_capacity(cpu_of(rq)); sched_avg_update(rq); } #else |