diff --git a/include/linux/sched/topology.h b/include/linux/sched/topology.h index 7fa0bc17cd8ce5259f87bc0863f983ece1bf1cd3..c31d3a47a47cc57478a25c0738cb7224a158c30e 100644 --- a/include/linux/sched/topology.h +++ b/include/linux/sched/topology.h @@ -201,6 +201,14 @@ extern void set_sched_topology(struct sched_domain_topology_level *tl); # define SD_INIT_NAME(type) #endif +#ifndef arch_scale_cpu_capacity +static __always_inline +unsigned long arch_scale_cpu_capacity(struct sched_domain *sd, int cpu) +{ + return SCHED_CAPACITY_SCALE; +} +#endif + #else /* CONFIG_SMP */ struct sched_domain_attr; @@ -216,6 +224,14 @@ static inline bool cpus_share_cache(int this_cpu, int that_cpu) return true; } +#ifndef arch_scale_cpu_capacity +static __always_inline +unsigned long arch_scale_cpu_capacity(void __always_unused *sd, int cpu) +{ + return SCHED_CAPACITY_SCALE; +} +#endif + #endif /* !CONFIG_SMP */ static inline int task_node(const struct task_struct *p) diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index ceb896404869b00771ec43ab55a18d700ffc4290..66067152a831aa4ffeba225767dcf4b363ac69cc 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -1859,24 +1859,6 @@ unsigned long arch_scale_freq_capacity(int cpu) } #endif -#ifdef CONFIG_SMP -#ifndef arch_scale_cpu_capacity -static __always_inline -unsigned long arch_scale_cpu_capacity(struct sched_domain *sd, int cpu) -{ - return SCHED_CAPACITY_SCALE; -} -#endif -#else -#ifndef arch_scale_cpu_capacity -static __always_inline -unsigned long arch_scale_cpu_capacity(void __always_unused *sd, int cpu) -{ - return SCHED_CAPACITY_SCALE; -} -#endif -#endif - #ifdef CONFIG_SMP #ifdef CONFIG_PREEMPT