aboutsummaryrefslogtreecommitdiff
path: root/kernel/sched/fair.c
diff options
context:
space:
mode:
authorJuri Lelli <juri.lelli@arm.com>2015-11-10 15:40:03 +0000
committerJuri Lelli <juri.lelli@arm.com>2015-11-10 15:40:03 +0000
commitd47adb96ef6311d77b15eda46c96eca31e10bc19 (patch)
tree0dd4af003d87bbb9ad636c692d5fb757045da046 /kernel/sched/fair.c
parentb9ed5586638749771886164255c3259dc48eb4a2 (diff)
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 <juri.lelli@arm.com>
Diffstat (limited to 'kernel/sched/fair.c')
-rw-r--r--kernel/sched/fair.c24
1 files changed, 12 insertions, 12 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