From 6a2f47ca27fad36f99e8478a3807d4b8c7db80e7 Mon Sep 17 00:00:00 2001 From: Mike Travis Date: Fri, 27 Jun 2008 10:10:13 -0700 Subject: x86: add check for node passed to node_to_cpumask, v3 * When CONFIG_DEBUG_PER_CPU_MAPS is set, the node passed to node_to_cpumask and node_to_cpumask_ptr should be validated. If invalid, then a dump_stack is performed and a zero cpumask is returned. v2: Slightly different version to remove a compiler warning. v3: Redone to reflect moving setup.c -> setup_percpu.c Signed-off-by: Mike Travis Cc: Vegard Nossum Cc: "akpm@linux-foundation.org" Cc: Yinghai Lu Signed-off-by: Ingo Molnar --- include/asm-x86/topology.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'include/asm-x86/topology.h') diff --git a/include/asm-x86/topology.h b/include/asm-x86/topology.h index 1f97758..98e5f17 100644 --- a/include/asm-x86/topology.h +++ b/include/asm-x86/topology.h @@ -57,7 +57,12 @@ 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'. */ +/* Returns a bitmask of CPUs on Node 'node'. + * + * Side note: this function creates the returned cpumask on the stack + * so with a high NR_CPUS count, excessive stack space is used. The + * node_to_cpumask_ptr function should be used whenever possible. + */ static inline cpumask_t node_to_cpumask(int node) { return node_to_cpumask_map[node]; -- cgit v1.1