Skip to content

Commit 2258a5b

Browse files
committed
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>
1 parent b4a2f91 commit 2258a5b

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

‎arch/alpha/include/asm/topology.h‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,24 @@ static inline cpumask_t node_to_cpumask(int node)
3939
return node_cpu_mask;
4040
}
4141

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+
4258
#define pcibus_to_cpumask(bus) (cpu_online_map)
59+
#define cpumask_of_pcibus(bus) (cpu_online_mask)
4360

4461
#endif /* !CONFIG_NUMA */
4562
# include <asm-generic/topology.h>

‎arch/alpha/kernel/setup.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ int alpha_l3_cacheshape;
7979
unsigned long alpha_verbose_mcheck = CONFIG_VERBOSE_MCHECK_ON;
8080
#endif
8181

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+
8287
/* Which processor we booted from. */
8388
int boot_cpuid;
8489

0 commit comments

Comments
 (0)