Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 17194
b: refs/heads/master
c: 4b703a2
h: refs/heads/master
v: v3
  • Loading branch information
Anton Blanchard authored and Paul Mackerras committed Jan 9, 2006
1 parent 76040db commit d4a5ba5
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2c066042ecc3b0d811440002b74fa3778d4432cb
refs/heads/master: 4b703a231799f43f3414b62300b8ad6736a4aa9d
3 changes: 3 additions & 0 deletions trunk/arch/powerpc/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <linux/sysdev.h>
#include <linux/cpu.h>
#include <linux/notifier.h>
#include <linux/topology.h>

#include <asm/ptrace.h>
#include <asm/atomic.h>
Expand Down Expand Up @@ -568,6 +569,8 @@ void __init smp_cpus_done(unsigned int max_cpus)
smp_ops->setup_cpu(boot_cpuid);

set_cpus_allowed(current, old_mask);

dump_numa_cpu_topology();
}

#ifdef CONFIG_HOTPLUG_CPU
Expand Down
39 changes: 36 additions & 3 deletions trunk/arch/powerpc/mm/numa.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,41 @@ static void __init setup_nonnuma(void)
node_set_online(0);
}

static void __init dump_numa_topology(void)
void __init dump_numa_cpu_topology(void)
{
unsigned int node;
unsigned int cpu, count;

if (min_common_depth == -1 || !numa_enabled)
return;

for_each_online_node(node) {
printk(KERN_INFO "Node %d CPUs:", node);

count = 0;
/*
* If we used a CPU iterator here we would miss printing
* the holes in the cpumap.
*/
for (cpu = 0; cpu < NR_CPUS; cpu++) {
if (cpu_isset(cpu, numa_cpumask_lookup_table[node])) {
if (count == 0)
printk(" %u", cpu);
++count;
} else {
if (count > 1)
printk("-%u", cpu - 1);
count = 0;
}
}

if (count > 1)
printk("-%u", NR_CPUS - 1);
printk("\n");
}
}

static void __init dump_numa_memory_topology(void)
{
unsigned int node;
unsigned int count;
Expand Down Expand Up @@ -521,7 +555,6 @@ static void __init dump_numa_topology(void)
printk("-0x%lx", i);
printk("\n");
}
return;
}

/*
Expand Down Expand Up @@ -583,7 +616,7 @@ void __init do_init_bootmem(void)
if (parse_numa_properties())
setup_nonnuma();
else
dump_numa_topology();
dump_numa_memory_topology();

register_cpu_notifier(&ppc64_numa_nb);

Expand Down
4 changes: 4 additions & 0 deletions trunk/include/asm-powerpc/topology.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,12 @@ static inline int node_to_first_cpu(int node)
.nr_balance_failed = 0, \
}

extern void __init dump_numa_cpu_topology(void);

#else

static inline void dump_numa_cpu_topology(void) {}

#include <asm-generic/topology.h>

#endif /* CONFIG_NUMA */
Expand Down

0 comments on commit d4a5ba5

Please sign in to comment.