diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2008-12-26 06:53:40 -0500 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2008-12-26 06:53:40 -0500 |
commit | fbb776c3ca4501d5a2821bf1e9bceefcaec7ae47 (patch) | |
tree | ef2b0bba2d31a6408224b4bedcd518b5e5ed6e5c /arch/ia64/sn | |
parent | 86c6f274f52c3e991d429869780945c0790e7b65 (diff) |
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>
Diffstat (limited to 'arch/ia64/sn')
-rw-r--r-- | arch/ia64/sn/kernel/sn2/sn_hwperf.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/arch/ia64/sn/kernel/sn2/sn_hwperf.c b/arch/ia64/sn/kernel/sn2/sn_hwperf.c index 636588e7e068..be339477f906 100644 --- a/arch/ia64/sn/kernel/sn2/sn_hwperf.c +++ b/arch/ia64/sn/kernel/sn2/sn_hwperf.c | |||
@@ -385,7 +385,6 @@ static int sn_topology_show(struct seq_file *s, void *d) | |||
385 | int j; | 385 | int j; |
386 | const char *slabname; | 386 | const char *slabname; |
387 | int ordinal; | 387 | int ordinal; |
388 | cpumask_t cpumask; | ||
389 | char slice; | 388 | char slice; |
390 | struct cpuinfo_ia64 *c; | 389 | struct cpuinfo_ia64 *c; |
391 | struct sn_hwperf_port_info *ptdata; | 390 | struct sn_hwperf_port_info *ptdata; |
@@ -473,23 +472,21 @@ static int sn_topology_show(struct seq_file *s, void *d) | |||
473 | * CPUs on this node, if any | 472 | * CPUs on this node, if any |
474 | */ | 473 | */ |
475 | if (!SN_HWPERF_IS_IONODE(obj)) { | 474 | if (!SN_HWPERF_IS_IONODE(obj)) { |
476 | cpumask = node_to_cpumask(ordinal); | 475 | for_each_cpu_and(i, cpu_online_mask, |
477 | for_each_online_cpu(i) { | 476 | cpumask_of_node(ordinal)) { |
478 | if (cpu_isset(i, cpumask)) { | 477 | slice = 'a' + cpuid_to_slice(i); |
479 | slice = 'a' + cpuid_to_slice(i); | 478 | c = cpu_data(i); |
480 | c = cpu_data(i); | 479 | seq_printf(s, "cpu %d %s%c local" |
481 | seq_printf(s, "cpu %d %s%c local" | 480 | " freq %luMHz, arch ia64", |
482 | " freq %luMHz, arch ia64", | 481 | i, obj->location, slice, |
483 | i, obj->location, slice, | 482 | c->proc_freq / 1000000); |
484 | c->proc_freq / 1000000); | 483 | for_each_online_cpu(j) { |
485 | for_each_online_cpu(j) { | 484 | seq_printf(s, j ? ":%d" : ", dist %d", |
486 | seq_printf(s, j ? ":%d" : ", dist %d", | 485 | node_distance( |
487 | node_distance( | ||
488 | cpu_to_node(i), | 486 | cpu_to_node(i), |
489 | cpu_to_node(j))); | 487 | cpu_to_node(j))); |
490 | } | ||
491 | seq_putc(s, '\n'); | ||
492 | } | 488 | } |
489 | seq_putc(s, '\n'); | ||
493 | } | 490 | } |
494 | } | 491 | } |
495 | } | 492 | } |