diff options
| author | Juri Lelli <juri.lelli@arm.com> | 2017-12-04 05:23:24 -0500 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2018-01-10 06:53:35 -0500 |
| commit | 7e1a9208f6c7e66bb4e5d2ed18dfd191230f431b (patch) | |
| tree | ddba1c6a602426607be83a8e4c766402a3c96382 /include/linux/sched | |
| parent | 7673c8a4c75d1cac2cd47156b9768f462683a09d (diff) | |
sched/cpufreq: Move arch_scale_{freq,cpu}_capacity() outside of #ifdef CONFIG_SMP
Currently, frequency and cpu capacity scaling is only performed on
CONFIG_SMP systems (as CFS PELT signals are only present for such
systems). However, other scheduling classes want to do freq/cpu scaling,
and for !CONFIG_SMP configurations as well.
arch_scale_freq_capacity() is useful to implement frequency scaling even
on !CONFIG_SMP platforms, so we simply move it outside CONFIG_SMP
ifdeffery.
Even if arch_scale_cpu_capacity() is not useful on !CONFIG_SMP platforms,
we make a default implementation available for such configurations anyway
to simplify scheduler code doing CPU scale invariance.
Signed-off-by: Juri Lelli <juri.lelli@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: alessio.balsini@arm.com
Cc: bristot@redhat.com
Cc: claudio@evidence.eu.com
Cc: dietmar.eggemann@arm.com
Cc: joelaf@google.com
Cc: juri.lelli@redhat.com
Cc: luca.abeni@santannapisa.it
Cc: mathieu.poirier@linaro.org
Cc: morten.rasmussen@arm.com
Cc: patrick.bellasi@arm.com
Cc: rjw@rjwysocki.net
Cc: tkjos@android.com
Cc: tommaso.cucinotta@santannapisa.it
Cc: vincent.guittot@linaro.org
Cc: viresh.kumar@linaro.org
Link: http://lkml.kernel.org/r/20171204102325.5110-8-juri.lelli@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/sched')
| -rw-r--r-- | include/linux/sched/topology.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/include/linux/sched/topology.h b/include/linux/sched/topology.h index cf257c2e728d..26347741ba50 100644 --- a/include/linux/sched/topology.h +++ b/include/linux/sched/topology.h | |||
| @@ -7,6 +7,12 @@ | |||
| 7 | #include <linux/sched/idle.h> | 7 | #include <linux/sched/idle.h> |
| 8 | 8 | ||
| 9 | /* | 9 | /* |
| 10 | * Increase resolution of cpu_capacity calculations | ||
| 11 | */ | ||
| 12 | #define SCHED_CAPACITY_SHIFT SCHED_FIXEDPOINT_SHIFT | ||
| 13 | #define SCHED_CAPACITY_SCALE (1L << SCHED_CAPACITY_SHIFT) | ||
| 14 | |||
| 15 | /* | ||
| 10 | * sched-domains (multiprocessor balancing) declarations: | 16 | * sched-domains (multiprocessor balancing) declarations: |
| 11 | */ | 17 | */ |
| 12 | #ifdef CONFIG_SMP | 18 | #ifdef CONFIG_SMP |
| @@ -27,12 +33,6 @@ | |||
| 27 | #define SD_OVERLAP 0x2000 /* sched_domains of this level overlap */ | 33 | #define SD_OVERLAP 0x2000 /* sched_domains of this level overlap */ |
| 28 | #define SD_NUMA 0x4000 /* cross-node balancing */ | 34 | #define SD_NUMA 0x4000 /* cross-node balancing */ |
| 29 | 35 | ||
| 30 | /* | ||
| 31 | * Increase resolution of cpu_capacity calculations | ||
| 32 | */ | ||
| 33 | #define SCHED_CAPACITY_SHIFT SCHED_FIXEDPOINT_SHIFT | ||
| 34 | #define SCHED_CAPACITY_SCALE (1L << SCHED_CAPACITY_SHIFT) | ||
| 35 | |||
| 36 | #ifdef CONFIG_SCHED_SMT | 36 | #ifdef CONFIG_SCHED_SMT |
| 37 | static inline int cpu_smt_flags(void) | 37 | static inline int cpu_smt_flags(void) |
| 38 | { | 38 | { |
