From d47adb96ef6311d77b15eda46c96eca31e10bc19 Mon Sep 17 00:00:00 2001 From: Juri Lelli Date: Tue, 10 Nov 2015 15:40:03 +0000 Subject: sched/fair: move capacity_curr_of outside CONFIG_SMP CONFIG_CPU_FREQ_GOV_SCHED configurations need to use capacity_curr_of; move it outside CONFIG_SMP regions. Once we do that arch_scale_freq_capacity as to be changed as well, because struct sched_domain is not defined on !CONFIG_SMP. Luckily, sd parameter is not used anywhere in that function, so we can simply clean it up. Signed-off-by: Juri Lelli --- kernel/sched/fair.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'kernel/sched/fair.c') 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) @@ -4451,17 +4462,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 -- cgit v1.2.3