aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/kernel/smp.c3
-rw-r--r--arch/powerpc/mm/numa.c39
-rw-r--r--include/asm-powerpc/topology.h4
3 files changed, 43 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 8e3ca674d359..d381ec90b759 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -31,6 +31,7 @@
31#include <linux/sysdev.h> 31#include <linux/sysdev.h>
32#include <linux/cpu.h> 32#include <linux/cpu.h>
33#include <linux/notifier.h> 33#include <linux/notifier.h>
34#include <linux/topology.h>
34 35
35#include <asm/ptrace.h> 36#include <asm/ptrace.h>
36#include <asm/atomic.h> 37#include <asm/atomic.h>
@@ -568,6 +569,8 @@ void __init smp_cpus_done(unsigned int max_cpus)
568 smp_ops->setup_cpu(boot_cpuid); 569 smp_ops->setup_cpu(boot_cpuid);
569 570
570 set_cpus_allowed(current, old_mask); 571 set_cpus_allowed(current, old_mask);
572
573 dump_numa_cpu_topology();
571} 574}
572 575
573#ifdef CONFIG_HOTPLUG_CPU 576#ifdef CONFIG_HOTPLUG_CPU
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 97e83f1d1bdb..fc519cd90f77 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -489,7 +489,41 @@ static void __init setup_nonnuma(void)
489 node_set_online(0); 489 node_set_online(0);
490} 490}
491 491
492static void __init dump_numa_topology(void) 492void __init dump_numa_cpu_topology(void)
493{
494 unsigned int node;
495 unsigned int cpu, count;
496
497 if (min_common_depth == -1 || !numa_enabled)
498 return;
499
500 for_each_online_node(node) {
501 printk(KERN_INFO "Node %d CPUs:", node);
502
503 count = 0;
504 /*
505 * If we used a CPU iterator here we would miss printing
506 * the holes in the cpumap.
507 */
508 for (cpu = 0; cpu < NR_CPUS; cpu++) {
509 if (cpu_isset(cpu, numa_cpumask_lookup_table[node])) {
510 if (count == 0)
511 printk(" %u", cpu);
512 ++count;
513 } else {
514 if (count > 1)
515 printk("-%u", cpu - 1);
516 count = 0;
517 }
518 }
519
520 if (count > 1)
521 printk("-%u", NR_CPUS - 1);
522 printk("\n");
523 }
524}
525
526static void __init dump_numa_memory_topology(void)
493{ 527{
494 unsigned int node; 528 unsigned int node;
495 unsigned int count; 529 unsigned int count;
@@ -521,7 +555,6 @@ static void __init dump_numa_topology(void)
521 printk("-0x%lx", i); 555 printk("-0x%lx", i);
522 printk("\n"); 556 printk("\n");
523 } 557 }
524 return;
525} 558}
526 559
527/* 560/*
@@ -583,7 +616,7 @@ void __init do_init_bootmem(void)
583 if (parse_numa_properties()) 616 if (parse_numa_properties())
584 setup_nonnuma(); 617 setup_nonnuma();
585 else 618 else
586 dump_numa_topology(); 619 dump_numa_memory_topology();
587 620
588 register_cpu_notifier(&ppc64_numa_nb); 621 register_cpu_notifier(&ppc64_numa_nb);
589 622
diff --git a/include/asm-powerpc/topology.h b/include/asm-powerpc/topology.h
index db8095cbe09b..f8a130af7d09 100644
--- a/include/asm-powerpc/topology.h
+++ b/include/asm-powerpc/topology.h
@@ -55,8 +55,12 @@ static inline int node_to_first_cpu(int node)
55 .nr_balance_failed = 0, \ 55 .nr_balance_failed = 0, \
56} 56}
57 57
58extern void __init dump_numa_cpu_topology(void);
59
58#else 60#else
59 61
62static inline void dump_numa_cpu_topology(void) {}
63
60#include <asm-generic/topology.h> 64#include <asm-generic/topology.h>
61 65
62#endif /* CONFIG_NUMA */ 66#endif /* CONFIG_NUMA */