diff mbox

[RFC,v2,02/11] sched: export cpu_smt_mask() and cpu_cpu_mask()

Message ID 1390221588-20473-3-git-send-email-dietmar.eggemann@arm.com
State New
Headers show

Commit Message

Dietmar Eggemann Jan. 20, 2014, 12:39 p.m. UTC
From: Dietmar Eggemann <dietmar.eggemann@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.eggemann@arm.com>
---
 include/linux/topology.h |   12 ++++++++++++
 kernel/sched/core.c      |   12 ------------
 2 files changed, 12 insertions(+), 12 deletions(-)
diff mbox

Patch

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.
  */