Commit c9f2bc8b authored by Anton Blanchard's avatar Anton Blanchard Committed by Linus Torvalds

[PATCH] ppc64: quieten NUMA boot messages

On some machines we would print hundreds of lines of NUMA debug output. 
The following patch cleans it up so we only print a summary of cpus and
memory vs nodes:

Node 0 CPUs: 0-1
Node 1 CPUs: 16-17
Node 2 CPUs: 32-33
Node 3 CPUs: 48-49
Node 0 Memory: 0x0-0x400000000
Node 1 Memory: 0x400000000-0x800000000

I lifted the code to do this out of xmon.
Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent f441198c
...@@ -18,11 +18,8 @@ ...@@ -18,11 +18,8 @@
#include <asm/machdep.h> #include <asm/machdep.h>
#include <asm/abs_addr.h> #include <asm/abs_addr.h>
#if 1 static int numa_debug;
#define dbg(args...) printk(KERN_INFO args) #define dbg(args...) if (numa_debug) { printk(KERN_INFO args); }
#else
#define dbg(args...)
#endif
#ifdef DEBUG_NUMA #ifdef DEBUG_NUMA
#define ARRAY_INITIALISER -1 #define ARRAY_INITIALISER -1
...@@ -48,7 +45,6 @@ EXPORT_SYMBOL(nr_cpus_in_node); ...@@ -48,7 +45,6 @@ EXPORT_SYMBOL(nr_cpus_in_node);
static inline void map_cpu_to_node(int cpu, int node) static inline void map_cpu_to_node(int cpu, int node)
{ {
dbg("cpu %d maps to domain %d\n", cpu, node);
numa_cpu_lookup_table[cpu] = node; numa_cpu_lookup_table[cpu] = node;
if (!(cpu_isset(cpu, numa_cpumask_lookup_table[node]))) { if (!(cpu_isset(cpu, numa_cpumask_lookup_table[node]))) {
cpu_set(cpu, numa_cpumask_lookup_table[node]); cpu_set(cpu, numa_cpumask_lookup_table[node]);
...@@ -107,8 +103,8 @@ static int of_node_numa_domain(struct device_node *device, int depth) ...@@ -107,8 +103,8 @@ static int of_node_numa_domain(struct device_node *device, int depth)
if (tmp && (tmp[0] >= depth)) { if (tmp && (tmp[0] >= depth)) {
numa_domain = tmp[depth]; numa_domain = tmp[depth];
} else { } else {
printk(KERN_ERR "WARNING: no NUMA information for " dbg("WARNING: no NUMA information for %s\n",
"%s\n", device->full_name); device->full_name);
numa_domain = 0; numa_domain = 0;
} }
return numa_domain; return numa_domain;
...@@ -137,11 +133,8 @@ static int find_min_common_depth(void) ...@@ -137,11 +133,8 @@ static int find_min_common_depth(void)
rtas_root = of_find_node_by_path("/rtas"); rtas_root = of_find_node_by_path("/rtas");
if (!rtas_root) { if (!rtas_root)
printk(KERN_ERR "WARNING: %s() could not find rtas root\n",
__FUNCTION__);
return -1; return -1;
}
/* /*
* this property is 2 32-bit integers, each representing a level of * this property is 2 32-bit integers, each representing a level of
...@@ -155,8 +148,8 @@ static int find_min_common_depth(void) ...@@ -155,8 +148,8 @@ static int find_min_common_depth(void)
if ((len >= 1) && ref_points) { if ((len >= 1) && ref_points) {
depth = ref_points[1]; depth = ref_points[1];
} else { } else {
printk(KERN_ERR "WARNING: could not find NUMA " dbg("WARNING: could not find NUMA "
"associativity reference point\n"); "associativity reference point\n");
depth = -1; depth = -1;
} }
of_node_put(rtas_root); of_node_put(rtas_root);
...@@ -187,6 +180,9 @@ static int __init parse_numa_properties(void) ...@@ -187,6 +180,9 @@ static int __init parse_numa_properties(void)
long entries = lmb_end_of_DRAM() >> MEMORY_INCREMENT_SHIFT; long entries = lmb_end_of_DRAM() >> MEMORY_INCREMENT_SHIFT;
unsigned long i; unsigned long i;
if (strstr(saved_command_line, "numa=debug"))
numa_debug = 1;
if (strstr(saved_command_line, "numa=off")) { if (strstr(saved_command_line, "numa=off")) {
printk(KERN_WARNING "NUMA disabled by user\n"); printk(KERN_WARNING "NUMA disabled by user\n");
return -1; return -1;
...@@ -200,7 +196,7 @@ static int __init parse_numa_properties(void) ...@@ -200,7 +196,7 @@ static int __init parse_numa_properties(void)
depth = find_min_common_depth(); depth = find_min_common_depth();
printk(KERN_INFO "NUMA associativity depth for CPU/Memory: %d\n", depth); dbg("NUMA associativity depth for CPU/Memory: %d\n", depth);
if (depth < 0) if (depth < 0)
return depth; return depth;
...@@ -225,8 +221,7 @@ static int __init parse_numa_properties(void) ...@@ -225,8 +221,7 @@ static int __init parse_numa_properties(void)
numa_domain = 0; numa_domain = 0;
} }
} else { } else {
printk(KERN_ERR "WARNING: no NUMA information for " dbg("WARNING: no NUMA information for cpu %ld\n", i);
"cpu %ld\n", i);
numa_domain = 0; numa_domain = 0;
} }
...@@ -286,9 +281,9 @@ static int __init parse_numa_properties(void) ...@@ -286,9 +281,9 @@ static int __init parse_numa_properties(void)
node_data[numa_domain].node_start_pfn + node_data[numa_domain].node_start_pfn +
node_data[numa_domain].node_spanned_pages; node_data[numa_domain].node_spanned_pages;
if (shouldstart != (start / PAGE_SIZE)) { if (shouldstart != (start / PAGE_SIZE)) {
printk(KERN_ERR "Hole in node, disabling " printk(KERN_ERR "WARNING: Hole in node, "
"region start %lx length %lx\n", "disabling region start %lx "
start, size); "length %lx\n", start, size);
continue; continue;
} }
node_data[numa_domain].node_spanned_pages += node_data[numa_domain].node_spanned_pages +=
...@@ -304,9 +299,6 @@ static int __init parse_numa_properties(void) ...@@ -304,9 +299,6 @@ static int __init parse_numa_properties(void)
numa_memory_lookup_table[i >> MEMORY_INCREMENT_SHIFT] = numa_memory_lookup_table[i >> MEMORY_INCREMENT_SHIFT] =
numa_domain; numa_domain;
dbg("memory region %lx to %lx maps to domain %d\n",
start, start+size, numa_domain);
ranges--; ranges--;
if (ranges) if (ranges)
goto new_range; goto new_range;
...@@ -350,6 +342,67 @@ static void __init setup_nonnuma(void) ...@@ -350,6 +342,67 @@ static void __init setup_nonnuma(void)
node0_io_hole_size = top_of_ram - total_ram; node0_io_hole_size = top_of_ram - total_ram;
} }
static void __init dump_numa_topology(void)
{
unsigned int node;
unsigned int cpu, count;
for (node = 0; node < MAX_NUMNODES; node++) {
if (!node_online(node))
continue;
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");
}
for (node = 0; node < MAX_NUMNODES; node++) {
unsigned long i;
if (!node_online(node))
continue;
printk(KERN_INFO "Node %d Memory:", node);
count = 0;
for (i = 0; i < lmb_end_of_DRAM(); i += MEMORY_INCREMENT) {
if (numa_memory_lookup_table[i >> MEMORY_INCREMENT_SHIFT] == node) {
if (count == 0)
printk(" 0x%lx", i);
++count;
} else {
if (count > 0)
printk("-0x%lx", i);
count = 0;
}
}
if (count > 0)
printk("-0x%lx", i);
printk("\n");
}
}
void __init do_init_bootmem(void) void __init do_init_bootmem(void)
{ {
int nid; int nid;
...@@ -360,6 +413,8 @@ void __init do_init_bootmem(void) ...@@ -360,6 +413,8 @@ void __init do_init_bootmem(void)
if (parse_numa_properties()) if (parse_numa_properties())
setup_nonnuma(); setup_nonnuma();
else
dump_numa_topology();
for (nid = 0; nid < numnodes; nid++) { for (nid = 0; nid < numnodes; nid++) {
unsigned long start_paddr, end_paddr; unsigned long start_paddr, end_paddr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment