Thread (153 messages) 153 messages, 11 authors, 2015-10-13

Re: [RFCv5 PATCH 01/46] arm: Frequency invariant scheduler load-tracking support

From: Vincent Guittot <vincent.guittot@linaro.org>
Date: 2015-08-03 09:23:14
Also in: lkml

Hi Morten,


On 7 July 2015 at 20:23, Morten Rasmussen [off-list ref] wrote:
From: Morten Rasmussen <redacted>
[snip]
quoted hunk ↗ jump to hunk
-
 #endif
diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c
index 08b7847..9c09e6e 100644
--- a/arch/arm/kernel/topology.c
+++ b/arch/arm/kernel/topology.c
@@ -169,6 +169,23 @@ static void update_cpu_capacity(unsigned int cpu)
                cpu, arch_scale_cpu_capacity(NULL, cpu));
 }

+/*
+ * Scheduler load-tracking scale-invariance
+ *
+ * Provides the scheduler with a scale-invariance correction factor that
+ * compensates for frequency scaling (arch_scale_freq_capacity()). The scaling
+ * factor is updated in smp.c
+ */
+unsigned long arm_arch_scale_freq_capacity(struct sched_domain *sd, int cpu)
+{
+       unsigned long curr = atomic_long_read(&per_cpu(cpu_freq_capacity, cpu));
access to cpu_freq_capacity to should be put under #ifdef CONFIG_CPU_FREQ.

Why haven't you moved arm_arch_scale_freq_capacity in smp.c as
everything else for frequency in-variance is already in this file ?
This should also enable you to remove
DECLARE_PER_CPU(atomic_long_t, cpu_freq_capacity); from topology.h

Vincent
+
+       if (!curr)
+               return SCHED_CAPACITY_SCALE;
+
+       return curr;
+}
+
 #else
 static inline void parse_dt_topology(void) {}
 static inline void update_cpu_capacity(unsigned int cpuid) {}
--
1.9.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help