aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/topology.h
diff options
context:
space:
mode:
authorMike Travis <travis@sgi.com>2008-05-12 15:21:12 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-08 05:31:24 -0400
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 c0e6ff7671ea..1f97758de4ab 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)
57} 57}
58#define early_cpu_to_node(cpu) cpu_to_node(cpu) 58#define early_cpu_to_node(cpu) cpu_to_node(cpu)
59 59
60/* Returns a bitmask of CPUs on Node 'node'. */
61static inline cpumask_t node_to_cpumask(int node)
62{
63 return node_to_cpumask_map[node];
64}
65
60#else /* CONFIG_X86_64 */ 66#else /* CONFIG_X86_64 */
61 67
62/* Mappings between node number and cpus on that node. */ 68/* Mappings between node number and cpus on that node. */
63extern cpumask_t node_to_cpumask_map[]; 69extern cpumask_t *node_to_cpumask_map;
64 70
65/* Mappings between logical cpu number and node number */ 71/* Mappings between logical cpu number and node number */
66DECLARE_EARLY_PER_CPU(int, x86_cpu_to_node_map); 72DECLARE_EARLY_PER_CPU(int, x86_cpu_to_node_map);
@@ -104,7 +110,6 @@ static inline cpumask_t node_to_cpumask(int node)
104} 110}
105 111
106#endif /* !CONFIG_DEBUG_PER_CPU_MAPS */ 112#endif /* !CONFIG_DEBUG_PER_CPU_MAPS */
107#endif /* CONFIG_X86_64 */
108 113
109/* Replace default node_to_cpumask_ptr with optimized version */ 114/* Replace default node_to_cpumask_ptr with optimized version */
110#define node_to_cpumask_ptr(v, node) \ 115#define node_to_cpumask_ptr(v, node) \
@@ -113,12 +118,7 @@ static inline cpumask_t node_to_cpumask(int node)
113#define node_to_cpumask_ptr_next(v, node) \ 118#define node_to_cpumask_ptr_next(v, node) \
114 v = _node_to_cpumask_ptr(node) 119 v = _node_to_cpumask_ptr(node)
115 120
116/* Returns the number of the first CPU on Node 'node'. */ 121#endif /* CONFIG_X86_64 */
117static inline int node_to_first_cpu(int node)
118{
119 node_to_cpumask_ptr(mask, node);
120 return first_cpu(*mask);
121}
122 122
123/* 123/*
124 * Returns the number of the node containing Node 'node'. This 124 * Returns the number of the node containing Node 'node'. This
@@ -204,6 +204,15 @@ static inline int node_to_first_cpu(int node)
204 204
205#include <asm-generic/topology.h> 205#include <asm-generic/topology.h>
206 206
207#ifdef CONFIG_NUMA
208/* Returns the number of the first CPU on Node 'node'. */
209static inline int node_to_first_cpu(int node)
210{
211 node_to_cpumask_ptr(mask, node);
212 return first_cpu(*mask);
213}
214#endif
215
207extern cpumask_t cpu_coregroup_map(int cpu); 216extern cpumask_t cpu_coregroup_map(int cpu);
208 217
209#ifdef ENABLE_TOPO_DEFINES 218#ifdef ENABLE_TOPO_DEFINES