cpumask: IA64: 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. We can also use the new for_each_cpu_and() to avoid a temporary cpumask, and a gratuitous test in sn_topology_show. (Includes fix from KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>) Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Cc: Tony Luck <tony.luck@intel.com> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
This commit is contained in:
@@ -385,7 +385,6 @@ static int sn_topology_show(struct seq_file *s, void *d)
|
||||
int j;
|
||||
const char *slabname;
|
||||
int ordinal;
|
||||
cpumask_t cpumask;
|
||||
char slice;
|
||||
struct cpuinfo_ia64 *c;
|
||||
struct sn_hwperf_port_info *ptdata;
|
||||
@@ -473,23 +472,21 @@ static int sn_topology_show(struct seq_file *s, void *d)
|
||||
* CPUs on this node, if any
|
||||
*/
|
||||
if (!SN_HWPERF_IS_IONODE(obj)) {
|
||||
cpumask = node_to_cpumask(ordinal);
|
||||
for_each_online_cpu(i) {
|
||||
if (cpu_isset(i, cpumask)) {
|
||||
slice = 'a' + cpuid_to_slice(i);
|
||||
c = cpu_data(i);
|
||||
seq_printf(s, "cpu %d %s%c local"
|
||||
" freq %luMHz, arch ia64",
|
||||
i, obj->location, slice,
|
||||
c->proc_freq / 1000000);
|
||||
for_each_online_cpu(j) {
|
||||
seq_printf(s, j ? ":%d" : ", dist %d",
|
||||
node_distance(
|
||||
for_each_cpu_and(i, cpu_online_mask,
|
||||
cpumask_of_node(ordinal)) {
|
||||
slice = 'a' + cpuid_to_slice(i);
|
||||
c = cpu_data(i);
|
||||
seq_printf(s, "cpu %d %s%c local"
|
||||
" freq %luMHz, arch ia64",
|
||||
i, obj->location, slice,
|
||||
c->proc_freq / 1000000);
|
||||
for_each_online_cpu(j) {
|
||||
seq_printf(s, j ? ":%d" : ", dist %d",
|
||||
node_distance(
|
||||
cpu_to_node(i),
|
||||
cpu_to_node(j)));
|
||||
}
|
||||
seq_putc(s, '\n');
|
||||
}
|
||||
seq_putc(s, '\n');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user