aboutsummaryrefslogtreecommitdiff
path: root/include/asm-x86/topology.h
diff options
context:
space:
mode:
authorMike Travis <travis@sgi.com>2008-05-12 21:21:12 +0200
committerIngo Molnar <mingo@elte.hu>2008-07-08 11:31:24 +0200
commit9f248bde9d47cc177011198c9a15fb339b9f3215 (patch)
treea6bb5bff1d8d786370b061eeb0958b413b941d41 /include/asm-x86/topology.h
parent7891a24e1ee50c96896c0cf7da216a8e7b573ca5 (diff)
x86: remove the static 256k node_to_cpumask_map
* Consolidate node_to_cpumask operations and remove the 256k byte node_to_cpumask_map. This is done by allocating the node_to_cpumask_map array after the number of possible nodes (nr_node_ids) is known. * Debug printouts when CONFIG_DEBUG_PER_CPU_MAPS is active have been increased. It now shows faults when calling node_to_cpumask() and node_to_cpumask_ptr(). For inclusion into sched-devel/latest tree. Based on: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git + sched-devel/latest .../mingo/linux-2.6-sched-devel.git Signed-off-by: Mike Travis <travis@sgi.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/asm-x86/topology.h')
-rw-r--r--include/asm-x86/topology.h25
1 files changed, 17 insertions, 8 deletions
diff --git a/include/asm-x86/topology.h b/include/asm-x86/topology.h
index c0e6ff7671e..1f97758de4a 100644
--- a/include/asm-x86/topology.h
+++ b/include/asm-x86/topology.h
@@ -57,10 +57,16 @@ static inline int cpu_to_node(int cpu)
}
#define early_cpu_to_node(cpu) cpu_to_node(cpu)
+/* Returns a bitmask of CPUs on Node 'node'. */
+static inline cpumask_t node_to_cpumask(int node)
+{
+ return node_to_cpumask_map[node];
+}
+
#else /* CONFIG_X86_64 */
/* Mappings between node number and cpus on that node. */
-extern cpumask_t node_to_cpumask_map[];
+extern cpumask_t *node_to_cpumask_map;
/* Mappings between logical cpu number and node number */
DECLARE_EARLY_PER_CPU(int, x86_cpu_to_node_map);
@@ -104,7 +110,6 @@ static inline cpumask_t node_to_cpumask(int node)
}
#endif /* !CONFIG_DEBUG_PER_CPU_MAPS */
-#endif /* CONFIG_X86_64 */
/* Replace default node_to_cpumask_ptr with optimized version */
#define node_to_cpumask_ptr(v, node) \
@@ -113,12 +118,7 @@ static inline cpumask_t node_to_cpumask(int node)
#define node_to_cpumask_ptr_next(v, node) \
v = _node_to_cpumask_ptr(node)
-/* Returns the number of the first CPU on Node 'node'. */
-static inline int node_to_first_cpu(int node)
-{
- node_to_cpumask_ptr(mask, node);
- return first_cpu(*mask);
-}
+#endif /* CONFIG_X86_64 */
/*
* Returns the number of the node containing Node 'node'. This
@@ -204,6 +204,15 @@ static inline int node_to_first_cpu(int node)
#include <asm-generic/topology.h>
+#ifdef CONFIG_NUMA
+/* Returns the number of the first CPU on Node 'node'. */
+static inline int node_to_first_cpu(int node)
+{
+ node_to_cpumask_ptr(mask, node);
+ return first_cpu(*mask);
+}
+#endif
+
extern cpumask_t cpu_coregroup_map(int cpu);
#ifdef ENABLE_TOPO_DEFINES