[PATCH 2/8] SGI x86_64 UV: Limit the number of processor bootup messages

From: Mike Travis
Date: Fri Oct 23 2009 - 19:46:10 EST


Limit the number of processor bootup messages when
system_state == SYSTEM_BOOTING. Limit the number of
offline messages when system is shutting down.

Cc: H. Peter Anvin <hpa@xxxxxxxxx>
Cc: x86@xxxxxxxxxx
Cc: Rusty Russell <rusty@xxxxxxxxxxxxxxx>
Cc: Yinghai Lu <yinghai@xxxxxxxxxx>
Cc: Tejun Heo <tj@xxxxxxxxxx>
Cc: linux-kernel@xxxxxxxxxxxxxxx
Signed-off-by: Mike Travis <travis@xxxxxxx>
---
Example output...

Before:

[ 36.305264] Booting processor 1/2 ip 6000
..
[ 36.420549] Booting processor 2/4 ip 6000
..
[ 101.352770] Booting processor 383/759 ip 6000
..
[ 101.524209] Brought up 384 CPUs
[ 101.528277] Total of 384 processors activated (1741075.97 BogoMIPS).

After:

[ 36.189152] Booting processor 1/2 ip 6000
..
[ 36.304541] Booting processor 2/4 ip 6000
..
[ 36.464533] printk: further related messages suppressed
[ 76.536185] Brought up 384 CPUs
[ 76.539894] Total of 384 processors activated (1741015.43 BogoMIPS).
---
arch/x86/kernel/smpboot.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)

--- linux.orig/arch/x86/kernel/smpboot.c
+++ linux/arch/x86/kernel/smpboot.c
@@ -741,6 +741,9 @@
/* start_ip had better be page-aligned! */
start_ip = setup_trampoline();

+ if (cpu > 2 && system_state == SYSTEM_BOOTING)
+ limit_console_output(true);
+
/* So we see what's up */
printk(KERN_INFO "Booting processor %d APIC 0x%x ip 0x%lx\n",
cpu, apicid, start_ip);
@@ -838,6 +841,9 @@
smpboot_restore_warm_reset_vector();
}

+ if (cpu > 2 && system_state == SYSTEM_BOOTING)
+ end_limit_console_output();
+
return boot_error;
}

@@ -1308,7 +1314,10 @@
for (i = 0; i < 10; i++) {
/* They ack this in play_dead by setting CPU_DEAD */
if (per_cpu(cpu_state, cpu) == CPU_DEAD) {
- printk(KERN_INFO "CPU %d is now offline\n", cpu);
+ if (cpu < 4 || system_state == SYSTEM_RUNNING ||
+ !limit_console_output(false))
+ printk(KERN_INFO
+ "CPU %d is now offline\n", cpu);
if (1 == num_online_cpus())
alternatives_smp_switch(0);
return;

--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/