lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1390221588-20473-3-git-send-email-dietmar.eggemann@arm.com>
Date:	Mon, 20 Jan 2014 12:39:39 +0000
From:	dietmar.eggemann@....com
To:	peterz@...radead.org, mingo@...hat.com, vincent.guittot@...aro.org,
	morten.rasmussen@....com, chris.redpath@....com
Cc:	linux-kernel@...r.kernel.org, dietmar.eggemann@....com
Subject: [RFC v2 PATCH 02/11] sched: export cpu_smt_mask() and cpu_cpu_mask()

From: Dietmar Eggemann <dietmar.eggemann@....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@....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 majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ