Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

cpumask: alpha: Introduce cpumask_of_{node,pcibus} to replace {node,pcibus}_to_cpumask

Impact: New APIs

The old node_to_cpumask/node_to_pcibus returned a cpumask_t: these
return a pointer to a struct cpumask. Part of removing cpumasks from
the stack.

I'm not sure the existing code even compiles, but new version is
straightforward.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: Richard Henderson <rth@twiddle.net>

+22
+17
arch/alpha/include/asm/topology.h
··· 39 39 return node_cpu_mask; 40 40 } 41 41 42 + extern struct cpumask node_to_cpumask_map[]; 43 + /* FIXME: This is dumb, recalculating every time. But simple. */ 44 + static const struct cpumask *cpumask_of_node(int node) 45 + { 46 + int cpu; 47 + 48 + cpumask_clear(&node_to_cpumask_map[node]); 49 + 50 + for_each_online_cpu(cpu) { 51 + if (cpu_to_node(cpu) == node) 52 + cpumask_set_cpu(cpu, node_to_cpumask_map[node]); 53 + } 54 + 55 + return &node_to_cpumask_map[node]; 56 + } 57 + 42 58 #define pcibus_to_cpumask(bus) (cpu_online_map) 59 + #define cpumask_of_pcibus(bus) (cpu_online_mask) 43 60 44 61 #endif /* !CONFIG_NUMA */ 45 62 # include <asm-generic/topology.h>
+5
arch/alpha/kernel/setup.c
··· 79 79 unsigned long alpha_verbose_mcheck = CONFIG_VERBOSE_MCHECK_ON; 80 80 #endif 81 81 82 + #ifdef CONFIG_NUMA 83 + struct cpumask node_to_cpumask_map[MAX_NUMNODES] __read_mostly; 84 + EXPORT_SYMBOL(node_to_cpumask_map); 85 + #endif 86 + 82 87 /* Which processor we booted from. */ 83 88 int boot_cpuid; 84 89