From: Dietmar Eggemann <dietmar.eggem...@arm.com>

Move cpu_smt_mask() and cpu_cpu_mask() from scheduler code into the
include/linux/topology.h so that an arch can use them for specifying cpu
masks for its topology info array.

Signed-off-by: Dietmar Eggemann <dietmar.eggem...@arm.com>
---
 include/linux/topology.h |   12 ++++++++++++
 kernel/sched/core.c      |   12 ------------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/include/linux/topology.h b/include/linux/topology.h
index 12ae6ce997d6..0bfcead0ace7 100644
--- a/include/linux/topology.h
+++ b/include/linux/topology.h
@@ -295,4 +295,16 @@ static inline int cpu_to_mem(int cpu)
 #define topology_core_cpumask(cpu)             cpumask_of(cpu)
 #endif
 
+#ifdef CONFIG_SCHED_SMT
+static inline const struct cpumask *cpu_smt_mask(int cpu)
+{
+       return topology_thread_cpumask(cpu);
+}
+#endif
+
+static inline const struct cpumask *cpu_cpu_mask(int cpu)
+{
+       return cpumask_of_node(cpu_to_node(cpu));
+}
+
 #endif /* _LINUX_TOPOLOGY_H */
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 8b8a37697a7d..523bb43756d6 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -4988,11 +4988,6 @@ static int __init isolated_cpu_setup(char *str)
 
 __setup("isolcpus=", isolated_cpu_setup);
 
-static const struct cpumask *cpu_cpu_mask(int cpu)
-{
-       return cpumask_of_node(cpu_to_node(cpu));
-}
-
 struct sd_data {
        struct sched_domain **__percpu sd;
        struct sched_group **__percpu sg;
@@ -5368,13 +5363,6 @@ static void claim_allocations(int cpu, struct 
sched_domain *sd)
                *per_cpu_ptr(sdd->sgp, cpu) = NULL;
 }
 
-#ifdef CONFIG_SCHED_SMT
-static const struct cpumask *cpu_smt_mask(int cpu)
-{
-       return topology_thread_cpumask(cpu);
-}
-#endif
-
 /*
  * Topology list, bottom-up.
  */
-- 
1.7.9.5


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to