* [PATCH 0/5] Limit console output by suppressing repetitious messages
@ 2009-11-18 0:22 Mike Travis
2009-11-18 0:22 ` [PATCH 1/5] x86: Limit the number of processor bootup messages Mike Travis
` (4 more replies)
0 siblings, 5 replies; 16+ messages in thread
From: Mike Travis @ 2009-11-18 0:22 UTC (permalink / raw)
To: Ingo Molnar, Thomas Gleixner, Andrew Morton
Cc: Heiko Carstens, Roland Dreier, Randy Dunlap, Tejun Heo,
Andi Kleen, Greg Kroah-Hartman, Yinghai Lu, H. Peter Anvin,
David Rientjes, Steven Rostedt, Rusty Russell, Hidetoshi Seto,
Jack Steiner, Frederic Weisbecker, x86, linux-kernel
Fifth version...
- Print Processor and Core ID's only for first cpu booted.
Fourth version...
- Make the cpu bootup message a static (inlinable) function.
- Remove the reference of smp_processor_id == 0 indicating the boot cpu.
- Moved Hidetoshi's latest patch (with mods to not use pr_cont()) to
separate thread.
Third version...
- Remove Processor Summary at end of bootup sequence and added '#'
to CPU numbers. This makes it a bit easier to pick up the context if
an error message disrupts the single output line of cpus.
- Remove cacheline size printout changes (dealt with in other patches)
- Modify MCE handler to send msgs to kernel debug log buffer and to not
output an extra '\n' per cpu.
- ACPI messages moved to separate thread since they need to be submitted
via the acpi group.
--
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 1/5] x86: Limit the number of processor bootup messages
2009-11-18 0:22 [PATCH 0/5] Limit console output by suppressing repetitious messages Mike Travis
@ 2009-11-18 0:22 ` Mike Travis
2009-11-18 2:45 ` Yinghai Lu
2009-11-26 9:15 ` Ingo Molnar
2009-11-18 0:22 ` [PATCH 2/5] INIT: Limit the number of per cpu calibration " Mike Travis
` (3 subsequent siblings)
4 siblings, 2 replies; 16+ messages in thread
From: Mike Travis @ 2009-11-18 0:22 UTC (permalink / raw)
To: Ingo Molnar, Thomas Gleixner, Andrew Morton
Cc: Heiko Carstens, Roland Dreier, Randy Dunlap, Tejun Heo,
Andi Kleen, Greg Kroah-Hartman, Yinghai Lu, H. Peter Anvin,
David Rientjes, Steven Rostedt, Rusty Russell, Hidetoshi Seto,
Jack Steiner, Frederic Weisbecker, x86, linux-kernel
[-- Attachment #1: limit_boot_cpu_messages --]
[-- Type: text/plain, Size: 7861 bytes --]
When there are a large number of processors in a system, there
is an excessive amount of messages sent to the system console.
It's estimated that with 4096 processors in a system, and the
console baudrate set to 56K, the startup messages will take
about 84 minutes to clear the serial port.
This set of patches limits the number of repetitious messages
which contain no additional information. Much of this information
is obtainable from the /proc and /sysfs. Some of the messages
are also sent to the kernel log buffer as KERN_DEBUG messages so
dmesg can be used to examine more closely any details specific to
a problem.
The new cpu bootup sequence for system_state == SYSTEM_BOOTING:
Booting Node 0, Processors #1 #2 #3 #4 #5 #6 #7 Ok.
Booting Node 1, Processors #8 #9 #10 #11 #12 #13 #14 #15 Ok.
..
Booting Node 3, Processors #56 #57 #58 #59 #60 #61 #62 #63 Ok.
Brought up 64 CPUs
After the system is running, the standard Boot message is displayed:
Booting Processor %d APIC 0x%x
Status of the following lines:
CPU: Physical Processor ID: printed once (for boot cpu)
CPU: Processor Core ID: printed once (for boot cpu)
CPU: Hyper-Threading is disabled printed once (for boot cpu)
CPU: Thermal monitoring enabled printed once (for boot cpu)
CPU %d/0x%x -> Node %d: removed
CPU %d is now offline: only if system_state == RUNNING
Initializing CPU#%d: KERN_DEBUG
Signed-off-by: Mike Travis <travis@sgi.com>
---
arch/x86/kernel/cpu/addon_cpuid_features.c | 15 +++++----
arch/x86/kernel/cpu/amd.c | 2 -
arch/x86/kernel/cpu/common.c | 12 ++++---
arch/x86/kernel/cpu/intel.c | 2 -
arch/x86/kernel/cpu/mcheck/therm_throt.c | 8 +++--
arch/x86/kernel/smpboot.c | 46 ++++++++++++++++++++---------
6 files changed, 54 insertions(+), 31 deletions(-)
--- linux.orig/arch/x86/kernel/cpu/addon_cpuid_features.c
+++ linux/arch/x86/kernel/cpu/addon_cpuid_features.c
@@ -74,6 +74,7 @@
unsigned int eax, ebx, ecx, edx, sub_index;
unsigned int ht_mask_width, core_plus_mask_width;
unsigned int core_select_mask, core_level_siblings;
+ static bool printed;
if (c->cpuid_level < 0xb)
return;
@@ -127,12 +128,14 @@
c->x86_max_cores = (core_level_siblings / smp_num_siblings);
-
- printk(KERN_INFO "CPU: Physical Processor ID: %d\n",
- c->phys_proc_id);
- if (c->x86_max_cores > 1)
- printk(KERN_INFO "CPU: Processor Core ID: %d\n",
- c->cpu_core_id);
+ if (!printed) {
+ printk(KERN_INFO "CPU: Physical Processor ID: %d\n",
+ c->phys_proc_id);
+ if (c->x86_max_cores > 1)
+ printk(KERN_INFO "CPU: Processor Core ID: %d\n",
+ c->cpu_core_id);
+ printed = 1;
+ }
return;
#endif
}
--- linux.orig/arch/x86/kernel/cpu/amd.c
+++ linux/arch/x86/kernel/cpu/amd.c
@@ -375,8 +375,6 @@
node = nearby_node(apicid);
}
numa_set_node(cpu, node);
-
- printk(KERN_INFO "CPU %d/0x%x -> Node %d\n", cpu, apicid, node);
#endif
}
--- linux.orig/arch/x86/kernel/cpu/common.c
+++ linux/arch/x86/kernel/cpu/common.c
@@ -432,6 +432,7 @@
#ifdef CONFIG_X86_HT
u32 eax, ebx, ecx, edx;
int index_msb, core_bits;
+ static bool printed;
if (!cpu_has(c, X86_FEATURE_HT))
return;
@@ -446,9 +447,9 @@
smp_num_siblings = (ebx & 0xff0000) >> 16;
- if (smp_num_siblings == 1) {
- printk(KERN_INFO "CPU: Hyper-Threading is disabled\n");
- goto out;
+ if (smp_num_siblings == 1 && c->cpu_index == 0) {
+ pr_info("CPU0: Hyper-Threading is disabled\n");
+ return;
}
if (smp_num_siblings <= 1)
@@ -474,11 +475,12 @@
((1 << core_bits) - 1);
out:
- if ((c->x86_max_cores * smp_num_siblings) > 1) {
+ if (!printed && (c->x86_max_cores * smp_num_siblings) > 1) {
printk(KERN_INFO "CPU: Physical Processor ID: %d\n",
c->phys_proc_id);
printk(KERN_INFO "CPU: Processor Core ID: %d\n",
c->cpu_core_id);
+ printed = 1;
}
#endif
}
@@ -1115,7 +1117,7 @@
if (cpumask_test_and_set_cpu(cpu, cpu_initialized_mask))
panic("CPU#%d already initialized!\n", cpu);
- printk(KERN_INFO "Initializing CPU#%d\n", cpu);
+ pr_debug("Initializing CPU#%d\n", cpu);
clear_in_cr4(X86_CR4_VME|X86_CR4_PVI|X86_CR4_TSD|X86_CR4_DE);
--- linux.orig/arch/x86/kernel/cpu/intel.c
+++ linux/arch/x86/kernel/cpu/intel.c
@@ -266,8 +266,6 @@
if (node == NUMA_NO_NODE || !node_online(node))
node = first_node(node_online_map);
numa_set_node(cpu, node);
-
- printk(KERN_INFO "CPU %d/0x%x -> Node %d\n", cpu, apicid, node);
#endif
}
--- linux.orig/arch/x86/kernel/cpu/mcheck/therm_throt.c
+++ linux/arch/x86/kernel/cpu/mcheck/therm_throt.c
@@ -259,6 +259,7 @@
unsigned int cpu = smp_processor_id();
int tm2 = 0;
u32 l, h;
+ static bool printed;
/* Thermal monitoring depends on ACPI and clock modulation*/
if (!cpu_has(c, X86_FEATURE_ACPI) || !cpu_has(c, X86_FEATURE_ACC))
@@ -312,8 +313,11 @@
l = apic_read(APIC_LVTTHMR);
apic_write(APIC_LVTTHMR, l & ~APIC_LVT_MASKED);
- printk(KERN_INFO "CPU%d: Thermal monitoring enabled (%s)\n",
- cpu, tm2 ? "TM2" : "TM1");
+ if (!printed) {
+ printk(KERN_INFO "CPU0: Thermal monitoring enabled (%s)\n",
+ tm2 ? "TM2" : "TM1");
+ printed = true;
+ }
/* enable thermal throttle processing */
atomic_set(&therm_throt_en, 1);
--- linux.orig/arch/x86/kernel/smpboot.c
+++ linux/arch/x86/kernel/smpboot.c
@@ -671,6 +671,27 @@
complete(&c_idle->done);
}
+/* reduce the number of lines printed when booting a large cpu count system */
+static void __cpuinit announce_cpu(int cpu, int apicid)
+{
+ if (system_state == SYSTEM_BOOTING) {
+#ifdef CONFIG_NUMA
+ static int current_node = -1;
+ int node = cpu_to_node(cpu);
+
+ if (node != current_node) {
+ if (current_node > (-1))
+ pr_cont(" Ok.\n");
+ current_node = node;
+ pr_info("Booting Node %3d, Processors ", node);
+ }
+ pr_cont(" #%d%s", cpu, cpu == (nr_cpu_ids - 1) ? " Ok.\n" : "");
+ return;
+#endif
+ }
+ pr_info("Booting Processor %d APIC 0x%x\n", cpu, apicid);
+}
+
/*
* NOTE - on most systems this is a PHYSICAL apic ID, but on multiquad
* (ie clustered apic addressing mode), this is a LOGICAL apic ID.
@@ -736,9 +757,8 @@
/* start_ip had better be page-aligned! */
start_ip = setup_trampoline();
- /* So we see what's up */
- printk(KERN_INFO "Booting processor %d APIC 0x%x ip 0x%lx\n",
- cpu, apicid, start_ip);
+ /* So we see what's up */
+ announce_cpu(cpu, apicid);
/*
* This grunge runs the startup process for
@@ -787,21 +807,17 @@
udelay(100);
}
- if (cpumask_test_cpu(cpu, cpu_callin_mask)) {
- /* number CPUs logically, starting from 1 (BSP is 0) */
- pr_debug("OK.\n");
- printk(KERN_INFO "CPU%d: ", cpu);
- print_cpu_info(&cpu_data(cpu));
- pr_debug("CPU has booted.\n");
- } else {
+ if (cpumask_test_cpu(cpu, cpu_callin_mask))
+ pr_debug("CPU%d: has booted.\n", cpu);
+ else {
boot_error = 1;
if (*((volatile unsigned char *)trampoline_base)
== 0xA5)
/* trampoline started but...? */
- printk(KERN_ERR "Stuck ??\n");
+ pr_err("CPU%d: Stuck ??\n", cpu);
else
/* trampoline code not run */
- printk(KERN_ERR "Not responding.\n");
+ pr_err("CPU%d: Not responding.\n", cpu);
if (apic->inquire_remote_apic)
apic->inquire_remote_apic(apicid);
}
@@ -1300,14 +1316,16 @@
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 (system_state == SYSTEM_RUNNING)
+ pr_info("CPU %u is now offline\n", cpu);
+
if (1 == num_online_cpus())
alternatives_smp_switch(0);
return;
}
msleep(100);
}
- printk(KERN_ERR "CPU %u didn't die...\n", cpu);
+ pr_err("CPU %u didn't die...\n", cpu);
}
void play_dead_common(void)
--
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 2/5] INIT: Limit the number of per cpu calibration bootup messages
2009-11-18 0:22 [PATCH 0/5] Limit console output by suppressing repetitious messages Mike Travis
2009-11-18 0:22 ` [PATCH 1/5] x86: Limit the number of processor bootup messages Mike Travis
@ 2009-11-18 0:22 ` Mike Travis
2009-11-26 9:55 ` [tip:timers/core] timers, init: " tip-bot for Mike Travis
2009-11-18 0:22 ` [PATCH 3/5] firmware: Limit the number of per cpu firmware messages during bootup Mike Travis
` (2 subsequent siblings)
4 siblings, 1 reply; 16+ messages in thread
From: Mike Travis @ 2009-11-18 0:22 UTC (permalink / raw)
To: Ingo Molnar, Thomas Gleixner, Andrew Morton
Cc: Heiko Carstens, Roland Dreier, Randy Dunlap, Tejun Heo,
Andi Kleen, Greg Kroah-Hartman, Yinghai Lu, H. Peter Anvin,
David Rientjes, Steven Rostedt, Rusty Russell, Hidetoshi Seto,
Jack Steiner, Frederic Weisbecker, x86, linux-kernel
[-- Attachment #1: limit_init_boot_messages --]
[-- Type: text/plain, Size: 2194 bytes --]
Limit the number of per cpu calibration messages by only printing
out results for the first cpu to boot.
Don't print "CPUx is down" as this is expected, and we don't need
4096 reminders... ;-)
Signed-off-by: Mike Travis <travis@sgi.com>
---
init/calibrate.c | 24 +++++++++++++++---------
kernel/cpu.c | 5 ++---
2 files changed, 17 insertions(+), 12 deletions(-)
--- linux.orig/init/calibrate.c
+++ linux/init/calibrate.c
@@ -123,23 +123,26 @@
{
unsigned long ticks, loopbit;
int lps_precision = LPS_PREC;
+ static bool printed;
if (preset_lpj) {
loops_per_jiffy = preset_lpj;
- printk(KERN_INFO
- "Calibrating delay loop (skipped) preset value.. ");
- } else if ((smp_processor_id() == 0) && lpj_fine) {
+ if (!printed)
+ pr_info("Calibrating delay loop (skipped) "
+ "preset value.. ");
+ } else if ((!printed) && lpj_fine) {
loops_per_jiffy = lpj_fine;
- printk(KERN_INFO
- "Calibrating delay loop (skipped), "
+ pr_info("Calibrating delay loop (skipped), "
"value calculated using timer frequency.. ");
} else if ((loops_per_jiffy = calibrate_delay_direct()) != 0) {
- printk(KERN_INFO
- "Calibrating delay using timer specific routine.. ");
+ if (!printed)
+ pr_info("Calibrating delay using timer "
+ "specific routine.. ");
} else {
loops_per_jiffy = (1<<12);
- printk(KERN_INFO "Calibrating delay loop... ");
+ if (!printed)
+ pr_info("Calibrating delay loop... ");
while ((loops_per_jiffy <<= 1) != 0) {
/* wait for "start of" clock tick */
ticks = jiffies;
@@ -170,7 +173,10 @@
loops_per_jiffy &= ~loopbit;
}
}
- printk(KERN_CONT "%lu.%02lu BogoMIPS (lpj=%lu)\n",
+ if (!printed)
+ pr_cont("%lu.%02lu BogoMIPS (lpj=%lu)\n",
loops_per_jiffy/(500000/HZ),
(loops_per_jiffy/(5000/HZ)) % 100, loops_per_jiffy);
+
+ printed = true;
}
--- linux.orig/kernel/cpu.c
+++ linux/kernel/cpu.c
@@ -392,10 +392,9 @@
if (cpu == first_cpu)
continue;
error = _cpu_down(cpu, 1);
- if (!error) {
+ if (!error)
cpumask_set_cpu(cpu, frozen_cpus);
- printk("CPU%d is down\n", cpu);
- } else {
+ else {
printk(KERN_ERR "Error taking CPU%d down: %d\n",
cpu, error);
break;
--
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 3/5] firmware: Limit the number of per cpu firmware messages during bootup
2009-11-18 0:22 [PATCH 0/5] Limit console output by suppressing repetitious messages Mike Travis
2009-11-18 0:22 ` [PATCH 1/5] x86: Limit the number of processor bootup messages Mike Travis
2009-11-18 0:22 ` [PATCH 2/5] INIT: Limit the number of per cpu calibration " Mike Travis
@ 2009-11-18 0:22 ` Mike Travis
2009-11-18 0:22 ` [PATCH 4/5] sched: Limit the number of scheduler debug messages Mike Travis
2009-11-18 0:22 ` [PATCH 5/5] x86: Limit number of per cpu TSC sync messages Mike Travis
4 siblings, 0 replies; 16+ messages in thread
From: Mike Travis @ 2009-11-18 0:22 UTC (permalink / raw)
To: Ingo Molnar, Thomas Gleixner, Andrew Morton
Cc: Heiko Carstens, Roland Dreier, Randy Dunlap, Tejun Heo,
Andi Kleen, Greg Kroah-Hartman, Yinghai Lu, H. Peter Anvin,
David Rientjes, Steven Rostedt, Rusty Russell, Hidetoshi Seto,
Jack Steiner, Frederic Weisbecker, x86, linux-kernel
[-- Attachment #1: limit_firmware_messages --]
[-- Type: text/plain, Size: 621 bytes --]
Limit the number of per cpu firmware: messages by sending them
only to the kernel debug log buffer.
[ 170.643130] firmware: requesting intel-ucode/06-2e-0
Signed-off-by: Mike Travis <travis@sgi.com>
---
drivers/base/firmware_class.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- linux.orig/drivers/base/firmware_class.c
+++ linux/drivers/base/firmware_class.c
@@ -495,7 +495,7 @@
}
if (uevent)
- dev_info(device, "firmware: requesting %s\n", name);
+ dev_dbg(device, "firmware: requesting %s\n", name);
retval = fw_setup_device(firmware, &f_dev, name, device, uevent);
if (retval)
--
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 4/5] sched: Limit the number of scheduler debug messages
2009-11-18 0:22 [PATCH 0/5] Limit console output by suppressing repetitious messages Mike Travis
` (2 preceding siblings ...)
2009-11-18 0:22 ` [PATCH 3/5] firmware: Limit the number of per cpu firmware messages during bootup Mike Travis
@ 2009-11-18 0:22 ` Mike Travis
2009-11-26 9:55 ` [tip:sched/core] " tip-bot for Mike Travis
2009-11-18 0:22 ` [PATCH 5/5] x86: Limit number of per cpu TSC sync messages Mike Travis
4 siblings, 1 reply; 16+ messages in thread
From: Mike Travis @ 2009-11-18 0:22 UTC (permalink / raw)
To: Ingo Molnar, Thomas Gleixner, Andrew Morton
Cc: Heiko Carstens, Roland Dreier, Randy Dunlap, Tejun Heo,
Andi Kleen, Greg Kroah-Hartman, Yinghai Lu, H. Peter Anvin,
David Rientjes, Steven Rostedt, Rusty Russell, Hidetoshi Seto,
Jack Steiner, Frederic Weisbecker, x86, linux-kernel
[-- Attachment #1: limit_sched_debug_messages --]
[-- Type: text/plain, Size: 1296 bytes --]
Remove the verbose scheduler debug messages unless kernel parameter
"sched_debug" set. /proc/sched_debug unchanged.
Signed-off-by: Mike Travis <travis@sgi.com>
---
Documentation/kernel-parameters.txt | 2 ++
kernel/sched.c | 13 +++++++++++++
2 files changed, 15 insertions(+)
--- linux.orig/Documentation/kernel-parameters.txt
+++ linux/Documentation/kernel-parameters.txt
@@ -2182,6 +2182,8 @@
sbni= [NET] Granch SBNI12 leased line adapter
+ sched_debug [KNL] Enables verbose scheduler debug messages.
+
sc1200wdt= [HW,WDT] SC1200 WDT (watchdog) driver
Format: <io>[,<timeout>[,<isapnp>]]
--- linux.orig/kernel/sched.c
+++ linux/kernel/sched.c
@@ -7743,6 +7743,16 @@
#ifdef CONFIG_SCHED_DEBUG
+static __read_mostly int sched_domain_debug_enabled;
+
+static int __init sched_domain_debug_setup(char *str)
+{
+ sched_domain_debug_enabled = 1;
+
+ return 0;
+}
+early_param("sched_debug", sched_domain_debug_setup);
+
static int sched_domain_debug_one(struct sched_domain *sd, int cpu, int level,
struct cpumask *groupmask)
{
@@ -7829,6 +7839,9 @@
cpumask_var_t groupmask;
int level = 0;
+ if (!sched_domain_debug_enabled)
+ return;
+
if (!sd) {
printk(KERN_DEBUG "CPU%d attaching NULL sched-domain.\n", cpu);
return;
--
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 5/5] x86: Limit number of per cpu TSC sync messages
2009-11-18 0:22 [PATCH 0/5] Limit console output by suppressing repetitious messages Mike Travis
` (3 preceding siblings ...)
2009-11-18 0:22 ` [PATCH 4/5] sched: Limit the number of scheduler debug messages Mike Travis
@ 2009-11-18 0:22 ` Mike Travis
2009-11-26 9:55 ` [tip:x86/debug] " tip-bot for Mike Travis
4 siblings, 1 reply; 16+ messages in thread
From: Mike Travis @ 2009-11-18 0:22 UTC (permalink / raw)
To: Ingo Molnar, Thomas Gleixner, Andrew Morton
Cc: Heiko Carstens, Roland Dreier, Randy Dunlap, Tejun Heo,
Andi Kleen, Greg Kroah-Hartman, Yinghai Lu, H. Peter Anvin,
David Rientjes, Steven Rostedt, Rusty Russell, Hidetoshi Seto,
Jack Steiner, Frederic Weisbecker, x86, linux-kernel
[-- Attachment #1: limit_tsc_sync_messages --]
[-- Type: text/plain, Size: 1401 bytes --]
Limit the number of per cpu TSC sync messages by only printing
to the console if an error occurs, otherwise print as a DEBUG
message.
The info message "Skipping synchronization ..." is only printed
after the last cpu has booted.
Signed-off-by: Mike Travis <travis@sgi.com>
---
arch/x86/kernel/tsc_sync.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
--- linux.orig/arch/x86/kernel/tsc_sync.c
+++ linux/arch/x86/kernel/tsc_sync.c
@@ -114,13 +114,12 @@
return;
if (boot_cpu_has(X86_FEATURE_TSC_RELIABLE)) {
- printk_once(KERN_INFO "Skipping synchronization checks as TSC is reliable.\n");
+ if (cpu == (nr_cpu_ids-1) || system_state != SYSTEM_BOOTING)
+ pr_info(
+ "Skipped synchronization checks as TSC is reliable.\n");
return;
}
- pr_info("checking TSC synchronization [CPU#%d -> CPU#%d]:",
- smp_processor_id(), cpu);
-
/*
* Reset it - in case this is a second bootup:
*/
@@ -142,12 +141,14 @@
cpu_relax();
if (nr_warps) {
- printk("\n");
+ pr_warning("TSC synchronization [CPU#%d -> CPU#%d]:\n",
+ smp_processor_id(), cpu);
pr_warning("Measured %Ld cycles TSC warp between CPUs, "
"turning off TSC clock.\n", max_warp);
mark_tsc_unstable("check_tsc_sync_source failed");
} else {
- printk(" passed.\n");
+ pr_debug("TSC synchronization [CPU#%d -> CPU#%d]: passed\n",
+ smp_processor_id(), cpu);
}
/*
--
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/5] x86: Limit the number of processor bootup messages
2009-11-18 0:22 ` [PATCH 1/5] x86: Limit the number of processor bootup messages Mike Travis
@ 2009-11-18 2:45 ` Yinghai Lu
2009-11-18 17:43 ` Mike Travis
2009-11-26 9:15 ` Ingo Molnar
1 sibling, 1 reply; 16+ messages in thread
From: Yinghai Lu @ 2009-11-18 2:45 UTC (permalink / raw)
To: Mike Travis
Cc: Ingo Molnar, Thomas Gleixner, Andrew Morton, Heiko Carstens,
Roland Dreier, Randy Dunlap, Tejun Heo, Andi Kleen,
Greg Kroah-Hartman, H. Peter Anvin, David Rientjes,
Steven Rostedt, Rusty Russell, Hidetoshi Seto, Jack Steiner,
Frederic Weisbecker, x86, linux-kernel
On Tue, Nov 17, 2009 at 4:22 PM, Mike Travis <travis@sgi.com> wrote:
> When there are a large number of processors in a system, there
> is an excessive amount of messages sent to the system console.
> It's estimated that with 4096 processors in a system, and the
> console baudrate set to 56K, the startup messages will take
> about 84 minutes to clear the serial port.
>
> This set of patches limits the number of repetitious messages
> which contain no additional information. Much of this information
> is obtainable from the /proc and /sysfs. Some of the messages
> are also sent to the kernel log buffer as KERN_DEBUG messages so
> dmesg can be used to examine more closely any details specific to
> a problem.
>
> The new cpu bootup sequence for system_state == SYSTEM_BOOTING:
>
> Booting Node 0, Processors #1 #2 #3 #4 #5 #6 #7 Ok.
> Booting Node 1, Processors #8 #9 #10 #11 #12 #13 #14 #15 Ok.
> ..
> Booting Node 3, Processors #56 #57 #58 #59 #60 #61 #62 #63 Ok.
> Brought up 64 CPUs
how about
Booting Node 0, Processors #1/0x01 #2/0x02 #3....
append apic id in hex after the numbering.?
YH
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/5] x86: Limit the number of processor bootup messages
2009-11-18 2:45 ` Yinghai Lu
@ 2009-11-18 17:43 ` Mike Travis
0 siblings, 0 replies; 16+ messages in thread
From: Mike Travis @ 2009-11-18 17:43 UTC (permalink / raw)
To: Yinghai Lu
Cc: Ingo Molnar, Thomas Gleixner, Andrew Morton, Heiko Carstens,
Roland Dreier, Randy Dunlap, Tejun Heo, Andi Kleen,
Greg Kroah-Hartman, H. Peter Anvin, David Rientjes,
Steven Rostedt, Rusty Russell, Hidetoshi Seto, Jack Steiner,
Frederic Weisbecker, x86, linux-kernel
Yinghai Lu wrote:
> On Tue, Nov 17, 2009 at 4:22 PM, Mike Travis <travis@sgi.com> wrote:
>> When there are a large number of processors in a system, there
>> is an excessive amount of messages sent to the system console.
>> It's estimated that with 4096 processors in a system, and the
>> console baudrate set to 56K, the startup messages will take
>> about 84 minutes to clear the serial port.
>>
>> This set of patches limits the number of repetitious messages
>> which contain no additional information. Much of this information
>> is obtainable from the /proc and /sysfs. Some of the messages
>> are also sent to the kernel log buffer as KERN_DEBUG messages so
>> dmesg can be used to examine more closely any details specific to
>> a problem.
>>
>> The new cpu bootup sequence for system_state == SYSTEM_BOOTING:
>>
>> Booting Node 0, Processors #1 #2 #3 #4 #5 #6 #7 Ok.
>> Booting Node 1, Processors #8 #9 #10 #11 #12 #13 #14 #15 Ok.
>> ..
>> Booting Node 3, Processors #56 #57 #58 #59 #60 #61 #62 #63 Ok.
>> Brought up 64 CPUs
>
> how about
> Booting Node 0, Processors #1/0x01 #2/0x02 #3....
> append apic id in hex after the numbering.?
>
> YH
The APIC id's are already listed earlier in the log. There are
some other APIC patches to deal with making the output clearer
as well as more/less verbose.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/5] x86: Limit the number of processor bootup messages
2009-11-18 0:22 ` [PATCH 1/5] x86: Limit the number of processor bootup messages Mike Travis
2009-11-18 2:45 ` Yinghai Lu
@ 2009-11-26 9:15 ` Ingo Molnar
2009-11-27 21:29 ` [PATCH] " Mike Travis
1 sibling, 1 reply; 16+ messages in thread
From: Ingo Molnar @ 2009-11-26 9:15 UTC (permalink / raw)
To: Mike Travis
Cc: Thomas Gleixner, Andrew Morton, Heiko Carstens, Roland Dreier,
Randy Dunlap, Tejun Heo, Andi Kleen, Greg Kroah-Hartman,
Yinghai Lu, H. Peter Anvin, David Rientjes, Steven Rostedt,
Rusty Russell, Hidetoshi Seto, Jack Steiner, Frederic Weisbecker,
x86, linux-kernel
* Mike Travis <travis@sgi.com> wrote:
> +++ linux/arch/x86/kernel/smpboot.c
> @@ -671,6 +671,27 @@
> complete(&c_idle->done);
> }
>
> +/* reduce the number of lines printed when booting a large cpu count system */
> +static void __cpuinit announce_cpu(int cpu, int apicid)
> +{
> + if (system_state == SYSTEM_BOOTING) {
> +#ifdef CONFIG_NUMA
> + static int current_node = -1;
> + int node = cpu_to_node(cpu);
> +
> + if (node != current_node) {
> + if (current_node > (-1))
> + pr_cont(" Ok.\n");
> + current_node = node;
> + pr_info("Booting Node %3d, Processors ", node);
> + }
> + pr_cont(" #%d%s", cpu, cpu == (nr_cpu_ids - 1) ? " Ok.\n" : "");
> + return;
> +#endif
> + }
That's pretty ugly. (the #ifdef is at the wrong nesting level to begin
with)
Also, cannot we print out the same thing with no #ifdef variances? Users
of UP systems wont be confused by a 'Node 0, CPU 0' message and in 5
years most x86 people will be running NUMA systems.
Ingo
^ permalink raw reply [flat|nested] 16+ messages in thread
* [tip:sched/core] sched: Limit the number of scheduler debug messages
2009-11-18 0:22 ` [PATCH 4/5] sched: Limit the number of scheduler debug messages Mike Travis
@ 2009-11-26 9:55 ` tip-bot for Mike Travis
0 siblings, 0 replies; 16+ messages in thread
From: tip-bot for Mike Travis @ 2009-11-26 9:55 UTC (permalink / raw)
To: linux-tip-commits
Cc: mingo, rusty, fweisbec, yhlu.kernel, rostedt, gregkh,
heiko.carstens, tglx, rientjes, linux-kernel, hpa, andi, travis,
seto.hidetoshi, rdunlap, rdreier, steiner, tj, mingo
Commit-ID: f6630114d9198aa959ac95c131334c020038f253
Gitweb: http://git.kernel.org/tip/f6630114d9198aa959ac95c131334c020038f253
Author: Mike Travis <travis@sgi.com>
AuthorDate: Tue, 17 Nov 2009 18:22:15 -0600
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Thu, 26 Nov 2009 10:17:30 +0100
sched: Limit the number of scheduler debug messages
Remove the verbose scheduler debug messages unless kernel
parameter "sched_debug" set. /proc/sched_debug unchanged.
Signed-off-by: Mike Travis <travis@sgi.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Roland Dreier <rdreier@cisco.com>
Cc: Randy Dunlap <rdunlap@xenotime.net>
Cc: Tejun Heo <tj@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Yinghai Lu <yhlu.kernel@gmail.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Cc: Jack Steiner <steiner@sgi.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <20091118002221.489305000@alcatraz.americas.sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
Documentation/kernel-parameters.txt | 2 ++
kernel/sched.c | 13 +++++++++++++
2 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 9107b38..f2a9507 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -2182,6 +2182,8 @@ and is between 256 and 4096 characters. It is defined in the file
sbni= [NET] Granch SBNI12 leased line adapter
+ sched_debug [KNL] Enables verbose scheduler debug messages.
+
sc1200wdt= [HW,WDT] SC1200 WDT (watchdog) driver
Format: <io>[,<timeout>[,<isapnp>]]
diff --git a/kernel/sched.c b/kernel/sched.c
index a57c6ae..48ff66a 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -7720,6 +7720,16 @@ early_initcall(migration_init);
#ifdef CONFIG_SCHED_DEBUG
+static __read_mostly int sched_domain_debug_enabled;
+
+static int __init sched_domain_debug_setup(char *str)
+{
+ sched_domain_debug_enabled = 1;
+
+ return 0;
+}
+early_param("sched_debug", sched_domain_debug_setup);
+
static int sched_domain_debug_one(struct sched_domain *sd, int cpu, int level,
struct cpumask *groupmask)
{
@@ -7806,6 +7816,9 @@ static void sched_domain_debug(struct sched_domain *sd, int cpu)
cpumask_var_t groupmask;
int level = 0;
+ if (!sched_domain_debug_enabled)
+ return;
+
if (!sd) {
printk(KERN_DEBUG "CPU%d attaching NULL sched-domain.\n", cpu);
return;
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [tip:x86/debug] x86: Limit number of per cpu TSC sync messages
2009-11-18 0:22 ` [PATCH 5/5] x86: Limit number of per cpu TSC sync messages Mike Travis
@ 2009-11-26 9:55 ` tip-bot for Mike Travis
0 siblings, 0 replies; 16+ messages in thread
From: tip-bot for Mike Travis @ 2009-11-26 9:55 UTC (permalink / raw)
To: linux-tip-commits
Cc: mingo, rusty, fweisbec, yhlu.kernel, rostedt, gregkh,
heiko.carstens, tglx, rientjes, linux-kernel, hpa, andi, travis,
seto.hidetoshi, rdunlap, rdreier, steiner, tj, mingo
Commit-ID: 9b3660a55a9052518c91cc7c62d89e22f3f6f490
Gitweb: http://git.kernel.org/tip/9b3660a55a9052518c91cc7c62d89e22f3f6f490
Author: Mike Travis <travis@sgi.com>
AuthorDate: Tue, 17 Nov 2009 18:22:16 -0600
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Thu, 26 Nov 2009 10:17:45 +0100
x86: Limit number of per cpu TSC sync messages
Limit the number of per cpu TSC sync messages by only printing
to the console if an error occurs, otherwise print as a DEBUG
message.
The info message "Skipping synchronization ..." is only printed
after the last cpu has booted.
Signed-off-by: Mike Travis <travis@sgi.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Roland Dreier <rdreier@cisco.com>
Cc: Randy Dunlap <rdunlap@xenotime.net>
Cc: Tejun Heo <tj@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Yinghai Lu <yhlu.kernel@gmail.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Cc: Jack Steiner <steiner@sgi.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <20091118002222.181053000@alcatraz.americas.sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/kernel/tsc_sync.c | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/arch/x86/kernel/tsc_sync.c b/arch/x86/kernel/tsc_sync.c
index f379309..eed1568 100644
--- a/arch/x86/kernel/tsc_sync.c
+++ b/arch/x86/kernel/tsc_sync.c
@@ -114,13 +114,12 @@ void __cpuinit check_tsc_sync_source(int cpu)
return;
if (boot_cpu_has(X86_FEATURE_TSC_RELIABLE)) {
- printk_once(KERN_INFO "Skipping synchronization checks as TSC is reliable.\n");
+ if (cpu == (nr_cpu_ids-1) || system_state != SYSTEM_BOOTING)
+ pr_info(
+ "Skipped synchronization checks as TSC is reliable.\n");
return;
}
- pr_info("checking TSC synchronization [CPU#%d -> CPU#%d]:",
- smp_processor_id(), cpu);
-
/*
* Reset it - in case this is a second bootup:
*/
@@ -142,12 +141,14 @@ void __cpuinit check_tsc_sync_source(int cpu)
cpu_relax();
if (nr_warps) {
- printk("\n");
+ pr_warning("TSC synchronization [CPU#%d -> CPU#%d]:\n",
+ smp_processor_id(), cpu);
pr_warning("Measured %Ld cycles TSC warp between CPUs, "
"turning off TSC clock.\n", max_warp);
mark_tsc_unstable("check_tsc_sync_source failed");
} else {
- printk(" passed.\n");
+ pr_debug("TSC synchronization [CPU#%d -> CPU#%d]: passed\n",
+ smp_processor_id(), cpu);
}
/*
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [tip:timers/core] timers, init: Limit the number of per cpu calibration bootup messages
2009-11-18 0:22 ` [PATCH 2/5] INIT: Limit the number of per cpu calibration " Mike Travis
@ 2009-11-26 9:55 ` tip-bot for Mike Travis
0 siblings, 0 replies; 16+ messages in thread
From: tip-bot for Mike Travis @ 2009-11-26 9:55 UTC (permalink / raw)
To: linux-tip-commits
Cc: mingo, rusty, fweisbec, yhlu.kernel, rostedt, gregkh,
heiko.carstens, tglx, rientjes, linux-kernel, hpa, andi, travis,
seto.hidetoshi, rdunlap, rdreier, steiner, tj, mingo
Commit-ID: feae3203d711db0a9965300ee6d592257fdaae4f
Gitweb: http://git.kernel.org/tip/feae3203d711db0a9965300ee6d592257fdaae4f
Author: Mike Travis <travis@sgi.com>
AuthorDate: Tue, 17 Nov 2009 18:22:13 -0600
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Thu, 26 Nov 2009 10:18:42 +0100
timers, init: Limit the number of per cpu calibration bootup messages
Limit the number of per cpu calibration messages by only
printing out results for the first cpu to boot.
Also, don't print "CPUx is down" as this is expected, and we
don't need 4096 reminders... ;-)
Signed-off-by: Mike Travis <travis@sgi.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Roland Dreier <rdreier@cisco.com>
Cc: Randy Dunlap <rdunlap@xenotime.net>
Cc: Tejun Heo <tj@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Yinghai Lu <yhlu.kernel@gmail.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Cc: Jack Steiner <steiner@sgi.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <20091118002219.889552000@alcatraz.americas.sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
init/calibrate.c | 24 +++++++++++++++---------
kernel/cpu.c | 5 ++---
2 files changed, 17 insertions(+), 12 deletions(-)
diff --git a/init/calibrate.c b/init/calibrate.c
index a379c90..6eb48e5 100644
--- a/init/calibrate.c
+++ b/init/calibrate.c
@@ -123,23 +123,26 @@ void __cpuinit calibrate_delay(void)
{
unsigned long ticks, loopbit;
int lps_precision = LPS_PREC;
+ static bool printed;
if (preset_lpj) {
loops_per_jiffy = preset_lpj;
- printk(KERN_INFO
- "Calibrating delay loop (skipped) preset value.. ");
- } else if ((smp_processor_id() == 0) && lpj_fine) {
+ if (!printed)
+ pr_info("Calibrating delay loop (skipped) "
+ "preset value.. ");
+ } else if ((!printed) && lpj_fine) {
loops_per_jiffy = lpj_fine;
- printk(KERN_INFO
- "Calibrating delay loop (skipped), "
+ pr_info("Calibrating delay loop (skipped), "
"value calculated using timer frequency.. ");
} else if ((loops_per_jiffy = calibrate_delay_direct()) != 0) {
- printk(KERN_INFO
- "Calibrating delay using timer specific routine.. ");
+ if (!printed)
+ pr_info("Calibrating delay using timer "
+ "specific routine.. ");
} else {
loops_per_jiffy = (1<<12);
- printk(KERN_INFO "Calibrating delay loop... ");
+ if (!printed)
+ pr_info("Calibrating delay loop... ");
while ((loops_per_jiffy <<= 1) != 0) {
/* wait for "start of" clock tick */
ticks = jiffies;
@@ -170,7 +173,10 @@ void __cpuinit calibrate_delay(void)
loops_per_jiffy &= ~loopbit;
}
}
- printk(KERN_CONT "%lu.%02lu BogoMIPS (lpj=%lu)\n",
+ if (!printed)
+ pr_cont("%lu.%02lu BogoMIPS (lpj=%lu)\n",
loops_per_jiffy/(500000/HZ),
(loops_per_jiffy/(5000/HZ)) % 100, loops_per_jiffy);
+
+ printed = true;
}
diff --git a/kernel/cpu.c b/kernel/cpu.c
index 6ba0f1e..7c4e271 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -392,10 +392,9 @@ int disable_nonboot_cpus(void)
if (cpu == first_cpu)
continue;
error = _cpu_down(cpu, 1);
- if (!error) {
+ if (!error)
cpumask_set_cpu(cpu, frozen_cpus);
- printk("CPU%d is down\n", cpu);
- } else {
+ else {
printk(KERN_ERR "Error taking CPU%d down: %d\n",
cpu, error);
break;
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH] x86: Limit the number of processor bootup messages
2009-11-26 9:15 ` Ingo Molnar
@ 2009-11-27 21:29 ` Mike Travis
0 siblings, 0 replies; 16+ messages in thread
From: Mike Travis @ 2009-11-27 21:29 UTC (permalink / raw)
To: Ingo Molnar
Cc: Thomas Gleixner, Andrew Morton, Heiko Carstens, Roland Dreier,
Randy Dunlap, Tejun Heo, Andi Kleen, Greg Kroah-Hartman,
Yinghai Lu, H. Peter Anvin, David Rientjes, Steven Rostedt,
Rusty Russell, Hidetoshi Seto, Jack Steiner, Frederic Weisbecker,
x86, linux-kernel
x86: Limit the number of processor bootup messages
When there are a large number of processors in a system, there
is an excessive amount of messages sent to the system console.
It's estimated that with 4096 processors in a system, and the
console baudrate set to 56K, the startup messages will take
about 84 minutes to clear the serial port.
This set of patches limits the number of repetitious messages
which contain no additional information. Much of this information
is obtainable from the /proc and /sysfs. Some of the messages
are also sent to the kernel log buffer as KERN_DEBUG messages so
dmesg can be used to examine more closely any details specific to
a problem.
The new cpu bootup sequence for system_state == SYSTEM_BOOTING:
Booting Node 0, Processors #1 #2 #3 #4 #5 #6 #7 Ok.
Booting Node 1, Processors #8 #9 #10 #11 #12 #13 #14 #15 Ok.
...
Booting Node 3, Processors #56 #57 #58 #59 #60 #61 #62 #63 Ok.
Brought up 64 CPUs
After the system is running, a single line boot message is displayed
when CPU's are hotplugged on:
Booting Node %d Processor %d APIC 0x%x
Status of the following lines:
CPU: Physical Processor ID: printed once (for boot cpu)
CPU: Processor Core ID: printed once (for boot cpu)
CPU: Hyper-Threading is disabled printed once (for boot cpu)
CPU: Thermal monitoring enabled printed once (for boot cpu)
CPU %d/0x%x -> Node %d: removed
CPU %d is now offline: only if system_state == RUNNING
Initializing CPU#%d: KERN_DEBUG
Signed-off-by: Mike Travis <travis@sgi.com>
---
Ingo Molnar wrote:
> * Mike Travis <travis@sgi.com> wrote:
>
>> +++ linux/arch/x86/kernel/smpboot.c
>> @@ -671,6 +671,27 @@
>> complete(&c_idle->done);
>> }
>>
>> +/* reduce the number of lines printed when booting a large cpu count system */
>> +static void __cpuinit announce_cpu(int cpu, int apicid)
>> +{
>> + if (system_state == SYSTEM_BOOTING) {
>> +#ifdef CONFIG_NUMA
>> + static int current_node = -1;
>> + int node = cpu_to_node(cpu);
>> +
>> + if (node != current_node) {
>> + if (current_node > (-1))
>> + pr_cont(" Ok.\n");
>> + current_node = node;
>> + pr_info("Booting Node %3d, Processors ", node);
>> + }
>> + pr_cont(" #%d%s", cpu, cpu == (nr_cpu_ids - 1) ? " Ok.\n" : "");
>> + return;
>> +#endif
>> + }
>
> That's pretty ugly. (the #ifdef is at the wrong nesting level to begin
> with)
>
> Also, cannot we print out the same thing with no #ifdef variances? Users
> of UP systems wont be confused by a 'Node 0, CPU 0' message and in 5
> years most x86 people will be running NUMA systems.
>
> Ingo
Sure thing, though note that the above is only for secondary processors.
Boot CPU is still displayed as it was before (except for the cache line
size removal in other patches.)
---
arch/x86/kernel/cpu/addon_cpuid_features.c | 15 +++++----
arch/x86/kernel/cpu/amd.c | 2 -
arch/x86/kernel/cpu/common.c | 12 ++++---
arch/x86/kernel/cpu/intel.c | 2 -
arch/x86/kernel/cpu/mcheck/therm_throt.c | 8 +++--
arch/x86/kernel/smpboot.c | 45 +++++++++++++++++++----------
6 files changed, 53 insertions(+), 31 deletions(-)
--- linux.orig/arch/x86/kernel/cpu/addon_cpuid_features.c
+++ linux/arch/x86/kernel/cpu/addon_cpuid_features.c
@@ -74,6 +74,7 @@
unsigned int eax, ebx, ecx, edx, sub_index;
unsigned int ht_mask_width, core_plus_mask_width;
unsigned int core_select_mask, core_level_siblings;
+ static bool printed;
if (c->cpuid_level < 0xb)
return;
@@ -127,12 +128,14 @@
c->x86_max_cores = (core_level_siblings / smp_num_siblings);
-
- printk(KERN_INFO "CPU: Physical Processor ID: %d\n",
- c->phys_proc_id);
- if (c->x86_max_cores > 1)
- printk(KERN_INFO "CPU: Processor Core ID: %d\n",
- c->cpu_core_id);
+ if (!printed) {
+ printk(KERN_INFO "CPU: Physical Processor ID: %d\n",
+ c->phys_proc_id);
+ if (c->x86_max_cores > 1)
+ printk(KERN_INFO "CPU: Processor Core ID: %d\n",
+ c->cpu_core_id);
+ printed = 1;
+ }
return;
#endif
}
--- linux.orig/arch/x86/kernel/cpu/amd.c
+++ linux/arch/x86/kernel/cpu/amd.c
@@ -375,8 +375,6 @@
node = nearby_node(apicid);
}
numa_set_node(cpu, node);
-
- printk(KERN_INFO "CPU %d/0x%x -> Node %d\n", cpu, apicid, node);
#endif
}
--- linux.orig/arch/x86/kernel/cpu/common.c
+++ linux/arch/x86/kernel/cpu/common.c
@@ -432,6 +432,7 @@
#ifdef CONFIG_X86_HT
u32 eax, ebx, ecx, edx;
int index_msb, core_bits;
+ static bool printed;
if (!cpu_has(c, X86_FEATURE_HT))
return;
@@ -446,9 +447,9 @@
smp_num_siblings = (ebx & 0xff0000) >> 16;
- if (smp_num_siblings == 1) {
- printk(KERN_INFO "CPU: Hyper-Threading is disabled\n");
- goto out;
+ if (smp_num_siblings == 1 && c->cpu_index == 0) {
+ pr_info("CPU0: Hyper-Threading is disabled\n");
+ return;
}
if (smp_num_siblings <= 1)
@@ -474,11 +475,12 @@
((1 << core_bits) - 1);
out:
- if ((c->x86_max_cores * smp_num_siblings) > 1) {
+ if (!printed && (c->x86_max_cores * smp_num_siblings) > 1) {
printk(KERN_INFO "CPU: Physical Processor ID: %d\n",
c->phys_proc_id);
printk(KERN_INFO "CPU: Processor Core ID: %d\n",
c->cpu_core_id);
+ printed = 1;
}
#endif
}
@@ -1115,7 +1117,7 @@
if (cpumask_test_and_set_cpu(cpu, cpu_initialized_mask))
panic("CPU#%d already initialized!\n", cpu);
- printk(KERN_INFO "Initializing CPU#%d\n", cpu);
+ pr_debug("Initializing CPU#%d\n", cpu);
clear_in_cr4(X86_CR4_VME|X86_CR4_PVI|X86_CR4_TSD|X86_CR4_DE);
--- linux.orig/arch/x86/kernel/cpu/intel.c
+++ linux/arch/x86/kernel/cpu/intel.c
@@ -266,8 +266,6 @@
if (node == NUMA_NO_NODE || !node_online(node))
node = first_node(node_online_map);
numa_set_node(cpu, node);
-
- printk(KERN_INFO "CPU %d/0x%x -> Node %d\n", cpu, apicid, node);
#endif
}
--- linux.orig/arch/x86/kernel/cpu/mcheck/therm_throt.c
+++ linux/arch/x86/kernel/cpu/mcheck/therm_throt.c
@@ -259,6 +259,7 @@
unsigned int cpu = smp_processor_id();
int tm2 = 0;
u32 l, h;
+ static bool printed;
/* Thermal monitoring depends on ACPI and clock modulation*/
if (!cpu_has(c, X86_FEATURE_ACPI) || !cpu_has(c, X86_FEATURE_ACC))
@@ -312,8 +313,11 @@
l = apic_read(APIC_LVTTHMR);
apic_write(APIC_LVTTHMR, l & ~APIC_LVT_MASKED);
- printk(KERN_INFO "CPU%d: Thermal monitoring enabled (%s)\n",
- cpu, tm2 ? "TM2" : "TM1");
+ if (!printed) {
+ printk(KERN_INFO "CPU0: Thermal monitoring enabled (%s)\n",
+ tm2 ? "TM2" : "TM1");
+ printed = true;
+ }
/* enable thermal throttle processing */
atomic_set(&therm_throt_en, 1);
--- linux.orig/arch/x86/kernel/smpboot.c
+++ linux/arch/x86/kernel/smpboot.c
@@ -671,6 +671,26 @@
complete(&c_idle->done);
}
+/* reduce the number of lines printed when booting a large cpu count system */
+static void __cpuinit announce_cpu(int cpu, int apicid)
+{
+ static int current_node = -1;
+ int node = cpu_to_node(cpu);
+
+ if (system_state == SYSTEM_BOOTING) {
+ if (node != current_node) {
+ if (current_node > (-1))
+ pr_cont(" Ok.\n");
+ current_node = node;
+ pr_info("Booting Node %3d, Processors ", node);
+ }
+ pr_cont(" #%d%s", cpu, cpu == (nr_cpu_ids - 1) ? " Ok.\n" : "");
+ return;
+ } else
+ pr_info("Booting Node %d Processor %d APIC 0x%x\n",
+ node, cpu, apicid);
+}
+
/*
* NOTE - on most systems this is a PHYSICAL apic ID, but on multiquad
* (ie clustered apic addressing mode), this is a LOGICAL apic ID.
@@ -736,9 +756,8 @@
/* start_ip had better be page-aligned! */
start_ip = setup_trampoline();
- /* So we see what's up */
- printk(KERN_INFO "Booting processor %d APIC 0x%x ip 0x%lx\n",
- cpu, apicid, start_ip);
+ /* So we see what's up */
+ announce_cpu(cpu, apicid);
/*
* This grunge runs the startup process for
@@ -787,21 +806,17 @@
udelay(100);
}
- if (cpumask_test_cpu(cpu, cpu_callin_mask)) {
- /* number CPUs logically, starting from 1 (BSP is 0) */
- pr_debug("OK.\n");
- printk(KERN_INFO "CPU%d: ", cpu);
- print_cpu_info(&cpu_data(cpu));
- pr_debug("CPU has booted.\n");
- } else {
+ if (cpumask_test_cpu(cpu, cpu_callin_mask))
+ pr_debug("CPU%d: has booted.\n", cpu);
+ else {
boot_error = 1;
if (*((volatile unsigned char *)trampoline_base)
== 0xA5)
/* trampoline started but...? */
- printk(KERN_ERR "Stuck ??\n");
+ pr_err("CPU%d: Stuck ??\n", cpu);
else
/* trampoline code not run */
- printk(KERN_ERR "Not responding.\n");
+ pr_err("CPU%d: Not responding.\n", cpu);
if (apic->inquire_remote_apic)
apic->inquire_remote_apic(apicid);
}
@@ -1300,14 +1315,16 @@
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 (system_state == SYSTEM_RUNNING)
+ pr_info("CPU %u is now offline\n", cpu);
+
if (1 == num_online_cpus())
alternatives_smp_switch(0);
return;
}
msleep(100);
}
- printk(KERN_ERR "CPU %u didn't die...\n", cpu);
+ pr_err("CPU %u didn't die...\n", cpu);
}
void play_dead_common(void)
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH] x86: Limit the number of processor bootup messages
@ 2009-12-11 1:19 Mike Travis
2010-01-19 5:07 ` Xiaotian Feng
0 siblings, 1 reply; 16+ messages in thread
From: Mike Travis @ 2009-12-11 1:19 UTC (permalink / raw)
To: Ingo Molnar
Cc: Thomas Gleixner, Andrew Morton, Roland Dreier, H. Peter Anvin,
Jack Steiner, x86, LKML
x86: Limit the number of processor bootup messages
When there are a large number of processors in a system, there
is an excessive amount of messages sent to the system console.
It's estimated that with 4096 processors in a system, and the
console baudrate set to 56K, the startup messages will take
about 84 minutes to clear the serial port.
This set of patches limits the number of repetitious messages
which contain no additional information. Much of this information
is obtainable from the /proc and /sysfs. Some of the messages
are also sent to the kernel log buffer as KERN_DEBUG messages so
dmesg can be used to examine more closely any details specific to
a problem.
The new cpu bootup sequence for system_state == SYSTEM_BOOTING:
Booting Node 0, Processors #1 #2 #3 #4 #5 #6 #7 Ok.
Booting Node 1, Processors #8 #9 #10 #11 #12 #13 #14 #15 Ok.
...
Booting Node 3, Processors #56 #57 #58 #59 #60 #61 #62 #63 Ok.
Brought up 64 CPUs
After the system is running, a single line boot message is displayed
when CPU's are hotplugged on:
Booting Node %d Processor %d APIC 0x%x
Status of the following lines:
CPU: Physical Processor ID: printed once (for boot cpu)
CPU: Processor Core ID: printed once (for boot cpu)
CPU: Hyper-Threading is disabled printed once (for boot cpu)
CPU: Thermal monitoring enabled printed once (for boot cpu)
CPU %d/0x%x -> Node %d: removed
CPU %d is now offline: only if system_state == RUNNING
Initializing CPU#%d: KERN_DEBUG
Signed-off-by: Mike Travis <travis@sgi.com>
---
arch/x86/kernel/cpu/addon_cpuid_features.c | 15 +++++----
arch/x86/kernel/cpu/amd.c | 2 -
arch/x86/kernel/cpu/common.c | 8 +++--
arch/x86/kernel/cpu/intel.c | 2 -
arch/x86/kernel/cpu/mcheck/therm_throt.c | 4 +-
arch/x86/kernel/smpboot.c | 45 +++++++++++++++++++----------
6 files changed, 47 insertions(+), 29 deletions(-)
--- linux.orig/arch/x86/kernel/cpu/addon_cpuid_features.c
+++ linux/arch/x86/kernel/cpu/addon_cpuid_features.c
@@ -74,6 +74,7 @@
unsigned int eax, ebx, ecx, edx, sub_index;
unsigned int ht_mask_width, core_plus_mask_width;
unsigned int core_select_mask, core_level_siblings;
+ static bool printed;
if (c->cpuid_level < 0xb)
return;
@@ -127,12 +128,14 @@
c->x86_max_cores = (core_level_siblings / smp_num_siblings);
-
- printk(KERN_INFO "CPU: Physical Processor ID: %d\n",
- c->phys_proc_id);
- if (c->x86_max_cores > 1)
- printk(KERN_INFO "CPU: Processor Core ID: %d\n",
- c->cpu_core_id);
+ if (!printed) {
+ printk(KERN_INFO "CPU: Physical Processor ID: %d\n",
+ c->phys_proc_id);
+ if (c->x86_max_cores > 1)
+ printk(KERN_INFO "CPU: Processor Core ID: %d\n",
+ c->cpu_core_id);
+ printed = 1;
+ }
return;
#endif
}
--- linux.orig/arch/x86/kernel/cpu/amd.c
+++ linux/arch/x86/kernel/cpu/amd.c
@@ -375,8 +375,6 @@
node = nearby_node(apicid);
}
numa_set_node(cpu, node);
-
- printk(KERN_INFO "CPU %d/0x%x -> Node %d\n", cpu, apicid, node);
#endif
}
--- linux.orig/arch/x86/kernel/cpu/common.c
+++ linux/arch/x86/kernel/cpu/common.c
@@ -427,6 +427,7 @@
#ifdef CONFIG_X86_HT
u32 eax, ebx, ecx, edx;
int index_msb, core_bits;
+ static bool printed;
if (!cpu_has(c, X86_FEATURE_HT))
return;
@@ -442,7 +443,7 @@
smp_num_siblings = (ebx & 0xff0000) >> 16;
if (smp_num_siblings == 1) {
- printk(KERN_INFO "CPU: Hyper-Threading is disabled\n");
+ printk_once(KERN_INFO "CPU0: Hyper-Threading is disabled\n");
goto out;
}
@@ -469,11 +470,12 @@
((1 << core_bits) - 1);
out:
- if ((c->x86_max_cores * smp_num_siblings) > 1) {
+ if (!printed && (c->x86_max_cores * smp_num_siblings) > 1) {
printk(KERN_INFO "CPU: Physical Processor ID: %d\n",
c->phys_proc_id);
printk(KERN_INFO "CPU: Processor Core ID: %d\n",
c->cpu_core_id);
+ printed = 1;
}
#endif
}
@@ -1115,7 +1117,7 @@
if (cpumask_test_and_set_cpu(cpu, cpu_initialized_mask))
panic("CPU#%d already initialized!\n", cpu);
- printk(KERN_INFO "Initializing CPU#%d\n", cpu);
+ pr_debug("Initializing CPU#%d\n", cpu);
clear_in_cr4(X86_CR4_VME|X86_CR4_PVI|X86_CR4_TSD|X86_CR4_DE);
--- linux.orig/arch/x86/kernel/cpu/intel.c
+++ linux/arch/x86/kernel/cpu/intel.c
@@ -266,8 +266,6 @@
if (node == NUMA_NO_NODE || !node_online(node))
node = first_node(node_online_map);
numa_set_node(cpu, node);
-
- printk(KERN_INFO "CPU %d/0x%x -> Node %d\n", cpu, apicid, node);
#endif
}
--- linux.orig/arch/x86/kernel/cpu/mcheck/therm_throt.c
+++ linux/arch/x86/kernel/cpu/mcheck/therm_throt.c
@@ -339,8 +339,8 @@
l = apic_read(APIC_LVTTHMR);
apic_write(APIC_LVTTHMR, l & ~APIC_LVT_MASKED);
- printk(KERN_INFO "CPU%d: Thermal monitoring enabled (%s)\n",
- cpu, tm2 ? "TM2" : "TM1");
+ printk_once(KERN_INFO "CPU0: Thermal monitoring enabled (%s)\n",
+ tm2 ? "TM2" : "TM1");
/* enable thermal throttle processing */
atomic_set(&therm_throt_en, 1);
--- linux.orig/arch/x86/kernel/smpboot.c
+++ linux/arch/x86/kernel/smpboot.c
@@ -671,6 +671,26 @@
complete(&c_idle->done);
}
+/* reduce the number of lines printed when booting a large cpu count system */
+static void __cpuinit announce_cpu(int cpu, int apicid)
+{
+ static int current_node = -1;
+ int node = cpu_to_node(cpu);
+
+ if (system_state == SYSTEM_BOOTING) {
+ if (node != current_node) {
+ if (current_node > (-1))
+ pr_cont(" Ok.\n");
+ current_node = node;
+ pr_info("Booting Node %3d, Processors ", node);
+ }
+ pr_cont(" #%d%s", cpu, cpu == (nr_cpu_ids - 1) ? " Ok.\n" : "");
+ return;
+ } else
+ pr_info("Booting Node %d Processor %d APIC 0x%x\n",
+ node, cpu, apicid);
+}
+
/*
* NOTE - on most systems this is a PHYSICAL apic ID, but on multiquad
* (ie clustered apic addressing mode), this is a LOGICAL apic ID.
@@ -736,9 +756,8 @@
/* start_ip had better be page-aligned! */
start_ip = setup_trampoline();
- /* So we see what's up */
- printk(KERN_INFO "Booting processor %d APIC 0x%x ip 0x%lx\n",
- cpu, apicid, start_ip);
+ /* So we see what's up */
+ announce_cpu(cpu, apicid);
/*
* This grunge runs the startup process for
@@ -787,21 +806,17 @@
udelay(100);
}
- if (cpumask_test_cpu(cpu, cpu_callin_mask)) {
- /* number CPUs logically, starting from 1 (BSP is 0) */
- pr_debug("OK.\n");
- printk(KERN_INFO "CPU%d: ", cpu);
- print_cpu_info(&cpu_data(cpu));
- pr_debug("CPU has booted.\n");
- } else {
+ if (cpumask_test_cpu(cpu, cpu_callin_mask))
+ pr_debug("CPU%d: has booted.\n", cpu);
+ else {
boot_error = 1;
if (*((volatile unsigned char *)trampoline_base)
== 0xA5)
/* trampoline started but...? */
- printk(KERN_ERR "Stuck ??\n");
+ pr_err("CPU%d: Stuck ??\n", cpu);
else
/* trampoline code not run */
- printk(KERN_ERR "Not responding.\n");
+ pr_err("CPU%d: Not responding.\n", cpu);
if (apic->inquire_remote_apic)
apic->inquire_remote_apic(apicid);
}
@@ -1291,14 +1306,16 @@
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 (system_state == SYSTEM_RUNNING)
+ pr_info("CPU %u is now offline\n", cpu);
+
if (1 == num_online_cpus())
alternatives_smp_switch(0);
return;
}
msleep(100);
}
- printk(KERN_ERR "CPU %u didn't die...\n", cpu);
+ pr_err("CPU %u didn't die...\n", cpu);
}
void play_dead_common(void)
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] x86: Limit the number of processor bootup messages
2009-12-11 1:19 [PATCH] x86: Limit the number of processor bootup messages Mike Travis
@ 2010-01-19 5:07 ` Xiaotian Feng
2010-01-19 15:22 ` Mike Travis
0 siblings, 1 reply; 16+ messages in thread
From: Xiaotian Feng @ 2010-01-19 5:07 UTC (permalink / raw)
To: Mike Travis
Cc: Ingo Molnar, Thomas Gleixner, Andrew Morton, Roland Dreier,
H. Peter Anvin, Jack Steiner, x86, LKML
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=UTF-8, Size: 11358 bytes --]
Could we consider such cases that system doesn't have a large numberof processors? This commit makes my system bootup message ugly ....
CPU0: Intel(R) Core(TM)2 Quad CPU Q9400 @ 2.66GHz stepping 0alockdep: fixing up alternatives.Booting Node 0, Processors #1lockdep: fixing up alternatives. #2lockdep: fixing up alternatives. #3Brought up 4 CPUsTotal of 4 processors activated (21278.36 BogoMIPS).
So if num_present_cpus < nr_cpu_ids, the output will never print OK.....And the output is also twisted with lockdep prints...
On Fri, Dec 11, 2009 at 9:19 AM, Mike Travis <travis@sgi.com> wrote:> x86: Limit the number of processor bootup messages>> When there are a large number of processors in a system, there> is an excessive amount of messages sent to the system console.> It's estimated that with 4096 processors in a system, and the> console baudrate set to 56K, the startup messages will take> about 84 minutes to clear the serial port.>> This set of patches limits the number of repetitious messages> which contain no additional information.  Much of this information> is obtainable from the /proc and /sysfs.  Some of the messages> are also sent to the kernel log buffer as KERN_DEBUG messages so> dmesg can be used to examine more closely any details specific to> a problem.>> The new cpu bootup sequence for system_state == SYSTEM_BOOTING:>> Booting Node  0, Processors  #1 #2 #3 #4 #5 #6 #7 Ok.> Booting Node  1, Processors  #8 #9 #10 #11 #12 #13 #14 #15 Ok.> ...> Booting Node  3, Processors  #56 #57 #58 #59 #60 #61 #62 #63 Ok.> Brought up 64 CPUs>> After the system is running, a single line boot message is displayed> when CPU's are hotplugged on:>>  Booting Node %d Processor %d APIC 0x%x>>> Status of the following lines:>>  CPU: Physical Processor ID:      printed once (for boot cpu)>  CPU: Processor Core ID:        printed once (for boot cpu)>  CPU: Hyper-Threading is disabled   printed once (for boot cpu)>  CPU: Thermal monitoring enabled    printed once (for boot cpu)>  CPU %d/0x%x -> Node %d:        removed>  CPU %d is now offline:        only if system_state == RUNNING>  Initializing CPU#%d:     KERN_DEBUG>> Signed-off-by: Mike Travis <travis@sgi.com>> ---> arch/x86/kernel/cpu/addon_cpuid_features.c |  15 +++++----> arch/x86/kernel/cpu/amd.c          |   2 -> arch/x86/kernel/cpu/common.c        |   8 +++--> arch/x86/kernel/cpu/intel.c         |   2 -> arch/x86/kernel/cpu/mcheck/therm_throt.c  |   4 +-> arch/x86/kernel/smpboot.c          |  45> +++++++++++++++++++----------> 6 files changed, 47 insertions(+), 29 deletions(-)>> --- linux.orig/arch/x86/kernel/cpu/addon_cpuid_features.c> +++ linux/arch/x86/kernel/cpu/addon_cpuid_features.c> @@ -74,6 +74,7 @@>     unsigned int eax, ebx, ecx, edx, sub_index;>     unsigned int ht_mask_width, core_plus_mask_width;>     unsigned int core_select_mask, core_level_siblings;> +    static bool printed;>>     if (c->cpuid_level < 0xb)>         return;> @@ -127,12 +128,14 @@>>     c->x86_max_cores = (core_level_siblings / smp_num_siblings);>> -> -    printk(KERN_INFO  "CPU: Physical Processor ID: %d\n",> -        c->phys_proc_id);> -    if (c->x86_max_cores > 1)> -        printk(KERN_INFO  "CPU: Processor Core ID: %d\n",> -            c->cpu_core_id);> +    if (!printed) {> +        printk(KERN_INFO  "CPU: Physical Processor ID: %d\n",> +            c->phys_proc_id);> +        if (c->x86_max_cores > 1)> +            printk(KERN_INFO  "CPU: Processor Core ID: %d\n",> +                c->cpu_core_id);> +        printed = 1;> +    }>     return;> #endif> }> --- linux.orig/arch/x86/kernel/cpu/amd.c> +++ linux/arch/x86/kernel/cpu/amd.c> @@ -375,8 +375,6 @@>             node = nearby_node(apicid);>     }>     numa_set_node(cpu, node);> -> -    printk(KERN_INFO "CPU %d/0x%x -> Node %d\n", cpu, apicid, node);> #endif> }>> --- linux.orig/arch/x86/kernel/cpu/common.c> +++ linux/arch/x86/kernel/cpu/common.c> @@ -427,6 +427,7 @@> #ifdef CONFIG_X86_HT>     u32 eax, ebx, ecx, edx;>     int index_msb, core_bits;> +    static bool printed;>>     if (!cpu_has(c, X86_FEATURE_HT))>         return;> @@ -442,7 +443,7 @@>     smp_num_siblings = (ebx & 0xff0000) >> 16;>>     if (smp_num_siblings == 1) {> -        printk(KERN_INFO  "CPU: Hyper-Threading is disabled\n");> +        printk_once(KERN_INFO "CPU0: Hyper-Threading is> disabled\n");>         goto out;>     }>> @@ -469,11 +470,12 @@>                    ((1 << core_bits) - 1);>> out:> -    if ((c->x86_max_cores * smp_num_siblings) > 1) {> +    if (!printed && (c->x86_max_cores * smp_num_siblings) > 1) {>         printk(KERN_INFO  "CPU: Physical Processor ID: %d\n",>            c->phys_proc_id);>         printk(KERN_INFO  "CPU: Processor Core ID: %d\n",>            c->cpu_core_id);> +        printed = 1;>     }> #endif> }> @@ -1115,7 +1117,7 @@>     if (cpumask_test_and_set_cpu(cpu, cpu_initialized_mask))>         panic("CPU#%d already initialized!\n", cpu);>> -    printk(KERN_INFO "Initializing CPU#%d\n", cpu);> +    pr_debug("Initializing CPU#%d\n", cpu);>>     clear_in_cr4(X86_CR4_VME|X86_CR4_PVI|X86_CR4_TSD|X86_CR4_DE);>> --- linux.orig/arch/x86/kernel/cpu/intel.c> +++ linux/arch/x86/kernel/cpu/intel.c> @@ -266,8 +266,6 @@>     if (node == NUMA_NO_NODE || !node_online(node))>         node = first_node(node_online_map);>     numa_set_node(cpu, node);> -> -    printk(KERN_INFO "CPU %d/0x%x -> Node %d\n", cpu, apicid, node);> #endif> }>> --- linux.orig/arch/x86/kernel/cpu/mcheck/therm_throt.c> +++ linux/arch/x86/kernel/cpu/mcheck/therm_throt.c> @@ -339,8 +339,8 @@>     l = apic_read(APIC_LVTTHMR);>     apic_write(APIC_LVTTHMR, l & ~APIC_LVT_MASKED);>> -    printk(KERN_INFO "CPU%d: Thermal monitoring enabled (%s)\n",> -        cpu, tm2 ? "TM2" : "TM1");> +    printk_once(KERN_INFO "CPU0: Thermal monitoring enabled (%s)\n",> +            tm2 ? "TM2" : "TM1");>>     /* enable thermal throttle processing */>     atomic_set(&therm_throt_en, 1);> --- linux.orig/arch/x86/kernel/smpboot.c> +++ linux/arch/x86/kernel/smpboot.c> @@ -671,6 +671,26 @@>     complete(&c_idle->done);> }>> +/* reduce the number of lines printed when booting a large cpu count system> */> +static void __cpuinit announce_cpu(int cpu, int apicid)> +{> +    static int current_node = -1;> +    int node = cpu_to_node(cpu);> +> +    if (system_state == SYSTEM_BOOTING) {> +        if (node != current_node) {> +            if (current_node > (-1))> +                pr_cont(" Ok.\n");> +            current_node = node;> +            pr_info("Booting Node %3d, Processors ", node);> +        }> +        pr_cont(" #%d%s", cpu, cpu == (nr_cpu_ids - 1) ? " Ok.\n" :> "");> +        return;> +    } else> +        pr_info("Booting Node %d Processor %d APIC 0x%x\n",> +            node, cpu, apicid);> +}> +> /*>  * NOTE - on most systems this is a PHYSICAL apic ID, but on multiquad>  * (ie clustered apic addressing mode), this is a LOGICAL apic ID.> @@ -736,9 +756,8 @@>     /* start_ip had better be page-aligned! */>     start_ip = setup_trampoline();>> -    /* So we see what's up  */> -    printk(KERN_INFO "Booting processor %d APIC 0x%x ip 0x%lx\n",> -             cpu, apicid, start_ip);> +    /* So we see what's up */> +    announce_cpu(cpu, apicid);>>     /*>     * This grunge runs the startup process for> @@ -787,21 +806,17 @@>             udelay(100);>         }>> -        if (cpumask_test_cpu(cpu, cpu_callin_mask)) {> -            /* number CPUs logically, starting from 1 (BSP is 0)> */> -            pr_debug("OK.\n");> -            printk(KERN_INFO "CPU%d: ", cpu);> -            print_cpu_info(&cpu_data(cpu));> -            pr_debug("CPU has booted.\n");> -        } else {> +        if (cpumask_test_cpu(cpu, cpu_callin_mask))> +            pr_debug("CPU%d: has booted.\n", cpu);> +        else {>             boot_error = 1;>             if (*((volatile unsigned char *)trampoline_base)>                     == 0xA5)>                 /* trampoline started but...? */> -                printk(KERN_ERR "Stuck ??\n");> +                pr_err("CPU%d: Stuck ??\n", cpu);>             else>                 /* trampoline code not run */> -                printk(KERN_ERR "Not responding.\n");> +                pr_err("CPU%d: Not responding.\n", cpu);>             if (apic->inquire_remote_apic)>                 apic->inquire_remote_apic(apicid);>         }> @@ -1291,14 +1306,16 @@>     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 (system_state == SYSTEM_RUNNING)> +                pr_info("CPU %u is now offline\n", cpu);> +>             if (1 == num_online_cpus())>                 alternatives_smp_switch(0);>             return;>         }>         msleep(100);>     }> -    printk(KERN_ERR "CPU %u didn't die...\n", cpu);> +    pr_err("CPU %u didn't die...\n", cpu);> }>> void play_dead_common(void)>> --> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in> the body of a message to majordomo@vger.kernel.org> More majordomo info at  http://vger.kernel.org/majordomo-info.html> Please read the FAQ at  http://www.tux.org/lkml/>ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] x86: Limit the number of processor bootup messages
2010-01-19 5:07 ` Xiaotian Feng
@ 2010-01-19 15:22 ` Mike Travis
0 siblings, 0 replies; 16+ messages in thread
From: Mike Travis @ 2010-01-19 15:22 UTC (permalink / raw)
To: Xiaotian Feng
Cc: Ingo Molnar, Thomas Gleixner, Andrew Morton, Roland Dreier,
H. Peter Anvin, Jack Steiner, x86, LKML
Sure, any suggestions for improvement are welcome. The general theme
of the changes though, was to limit the per cpu messages, and to rethink
the output of so many useless lines of information.
Thanks,
Mike
Xiaotian Feng wrote:
> Could we consider such cases that system doesn't have a large number
> of processors? This commit makes my system bootup message ugly ....
>
> CPU0: Intel(R) Core(TM)2 Quad CPU Q9400 @ 2.66GHz stepping 0a
> lockdep: fixing up alternatives.
> Booting Node 0, Processors #1lockdep: fixing up alternatives.
> #2lockdep: fixing up alternatives.
> #3
> Brought up 4 CPUs
> Total of 4 processors activated (21278.36 BogoMIPS).
>
> So if num_present_cpus < nr_cpu_ids, the output will never print OK.....
> And the output is also twisted with lockdep prints...
>
> On Fri, Dec 11, 2009 at 9:19 AM, Mike Travis <travis@sgi.com> wrote:
>> x86: Limit the number of processor bootup messages
>>
>> When there are a large number of processors in a system, there
>> is an excessive amount of messages sent to the system console.
>> It's estimated that with 4096 processors in a system, and the
>> console baudrate set to 56K, the startup messages will take
>> about 84 minutes to clear the serial port.
>>
>> This set of patches limits the number of repetitious messages
>> which contain no additional information. Much of this information
>> is obtainable from the /proc and /sysfs. Some of the messages
>> are also sent to the kernel log buffer as KERN_DEBUG messages so
>> dmesg can be used to examine more closely any details specific to
>> a problem.
>>
>> The new cpu bootup sequence for system_state == SYSTEM_BOOTING:
>>
>> Booting Node 0, Processors #1 #2 #3 #4 #5 #6 #7 Ok.
>> Booting Node 1, Processors #8 #9 #10 #11 #12 #13 #14 #15 Ok.
>> ...
>> Booting Node 3, Processors #56 #57 #58 #59 #60 #61 #62 #63 Ok.
>> Brought up 64 CPUs
>>
>> After the system is running, a single line boot message is displayed
>> when CPU's are hotplugged on:
>>
>> Booting Node %d Processor %d APIC 0x%x
>>
>>
>> Status of the following lines:
>>
>> CPU: Physical Processor ID: printed once (for boot cpu)
>> CPU: Processor Core ID: printed once (for boot cpu)
>> CPU: Hyper-Threading is disabled printed once (for boot cpu)
>> CPU: Thermal monitoring enabled printed once (for boot cpu)
>> CPU %d/0x%x -> Node %d: removed
>> CPU %d is now offline: only if system_state == RUNNING
>> Initializing CPU#%d: KERN_DEBUG
>>
>> Signed-off-by: Mike Travis <travis@sgi.com>
>> ---
>> arch/x86/kernel/cpu/addon_cpuid_features.c | 15 +++++----
>> arch/x86/kernel/cpu/amd.c | 2 -
>> arch/x86/kernel/cpu/common.c | 8 +++--
>> arch/x86/kernel/cpu/intel.c | 2 -
>> arch/x86/kernel/cpu/mcheck/therm_throt.c | 4 +-
>> arch/x86/kernel/smpboot.c | 45
>> +++++++++++++++++++----------
>> 6 files changed, 47 insertions(+), 29 deletions(-)
>>
>> --- linux.orig/arch/x86/kernel/cpu/addon_cpuid_features.c
>> +++ linux/arch/x86/kernel/cpu/addon_cpuid_features.c
>> @@ -74,6 +74,7 @@
>> unsigned int eax, ebx, ecx, edx, sub_index;
>> unsigned int ht_mask_width, core_plus_mask_width;
>> unsigned int core_select_mask, core_level_siblings;
>> + static bool printed;
>>
>> if (c->cpuid_level < 0xb)
>> return;
>> @@ -127,12 +128,14 @@
>>
>> c->x86_max_cores = (core_level_siblings / smp_num_siblings);
>>
>> -
>> - printk(KERN_INFO "CPU: Physical Processor ID: %d\n",
>> - c->phys_proc_id);
>> - if (c->x86_max_cores > 1)
>> - printk(KERN_INFO "CPU: Processor Core ID: %d\n",
>> - c->cpu_core_id);
>> + if (!printed) {
>> + printk(KERN_INFO "CPU: Physical Processor ID: %d\n",
>> + c->phys_proc_id);
>> + if (c->x86_max_cores > 1)
>> + printk(KERN_INFO "CPU: Processor Core ID: %d\n",
>> + c->cpu_core_id);
>> + printed = 1;
>> + }
>> return;
>> #endif
>> }
>> --- linux.orig/arch/x86/kernel/cpu/amd.c
>> +++ linux/arch/x86/kernel/cpu/amd.c
>> @@ -375,8 +375,6 @@
>> node = nearby_node(apicid);
>> }
>> numa_set_node(cpu, node);
>> -
>> - printk(KERN_INFO "CPU %d/0x%x -> Node %d\n", cpu, apicid, node);
>> #endif
>> }
>>
>> --- linux.orig/arch/x86/kernel/cpu/common.c
>> +++ linux/arch/x86/kernel/cpu/common.c
>> @@ -427,6 +427,7 @@
>> #ifdef CONFIG_X86_HT
>> u32 eax, ebx, ecx, edx;
>> int index_msb, core_bits;
>> + static bool printed;
>>
>> if (!cpu_has(c, X86_FEATURE_HT))
>> return;
>> @@ -442,7 +443,7 @@
>> smp_num_siblings = (ebx & 0xff0000) >> 16;
>>
>> if (smp_num_siblings == 1) {
>> - printk(KERN_INFO "CPU: Hyper-Threading is disabled\n");
>> + printk_once(KERN_INFO "CPU0: Hyper-Threading is
>> disabled\n");
>> goto out;
>> }
>>
>> @@ -469,11 +470,12 @@
>> ((1 << core_bits) - 1);
>>
>> out:
>> - if ((c->x86_max_cores * smp_num_siblings) > 1) {
>> + if (!printed && (c->x86_max_cores * smp_num_siblings) > 1) {
>> printk(KERN_INFO "CPU: Physical Processor ID: %d\n",
>> c->phys_proc_id);
>> printk(KERN_INFO "CPU: Processor Core ID: %d\n",
>> c->cpu_core_id);
>> + printed = 1;
>> }
>> #endif
>> }
>> @@ -1115,7 +1117,7 @@
>> if (cpumask_test_and_set_cpu(cpu, cpu_initialized_mask))
>> panic("CPU#%d already initialized!\n", cpu);
>>
>> - printk(KERN_INFO "Initializing CPU#%d\n", cpu);
>> + pr_debug("Initializing CPU#%d\n", cpu);
>>
>> clear_in_cr4(X86_CR4_VME|X86_CR4_PVI|X86_CR4_TSD|X86_CR4_DE);
>>
>> --- linux.orig/arch/x86/kernel/cpu/intel.c
>> +++ linux/arch/x86/kernel/cpu/intel.c
>> @@ -266,8 +266,6 @@
>> if (node == NUMA_NO_NODE || !node_online(node))
>> node = first_node(node_online_map);
>> numa_set_node(cpu, node);
>> -
>> - printk(KERN_INFO "CPU %d/0x%x -> Node %d\n", cpu, apicid, node);
>> #endif
>> }
>>
>> --- linux.orig/arch/x86/kernel/cpu/mcheck/therm_throt.c
>> +++ linux/arch/x86/kernel/cpu/mcheck/therm_throt.c
>> @@ -339,8 +339,8 @@
>> l = apic_read(APIC_LVTTHMR);
>> apic_write(APIC_LVTTHMR, l & ~APIC_LVT_MASKED);
>>
>> - printk(KERN_INFO "CPU%d: Thermal monitoring enabled (%s)\n",
>> - cpu, tm2 ? "TM2" : "TM1");
>> + printk_once(KERN_INFO "CPU0: Thermal monitoring enabled (%s)\n",
>> + tm2 ? "TM2" : "TM1");
>>
>> /* enable thermal throttle processing */
>> atomic_set(&therm_throt_en, 1);
>> --- linux.orig/arch/x86/kernel/smpboot.c
>> +++ linux/arch/x86/kernel/smpboot.c
>> @@ -671,6 +671,26 @@
>> complete(&c_idle->done);
>> }
>>
>> +/* reduce the number of lines printed when booting a large cpu count system
>> */
>> +static void __cpuinit announce_cpu(int cpu, int apicid)
>> +{
>> + static int current_node = -1;
>> + int node = cpu_to_node(cpu);
>> +
>> + if (system_state == SYSTEM_BOOTING) {
>> + if (node != current_node) {
>> + if (current_node > (-1))
>> + pr_cont(" Ok.\n");
>> + current_node = node;
>> + pr_info("Booting Node %3d, Processors ", node);
>> + }
>> + pr_cont(" #%d%s", cpu, cpu == (nr_cpu_ids - 1) ? " Ok.\n" :
>> "");
>> + return;
>> + } else
>> + pr_info("Booting Node %d Processor %d APIC 0x%x\n",
>> + node, cpu, apicid);
>> +}
>> +
>> /*
>> * NOTE - on most systems this is a PHYSICAL apic ID, but on multiquad
>> * (ie clustered apic addressing mode), this is a LOGICAL apic ID.
>> @@ -736,9 +756,8 @@
>> /* start_ip had better be page-aligned! */
>> start_ip = setup_trampoline();
>>
>> - /* So we see what's up */
>> - printk(KERN_INFO "Booting processor %d APIC 0x%x ip 0x%lx\n",
>> - cpu, apicid, start_ip);
>> + /* So we see what's up */
>> + announce_cpu(cpu, apicid);
>>
>> /*
>> * This grunge runs the startup process for
>> @@ -787,21 +806,17 @@
>> udelay(100);
>> }
>>
>> - if (cpumask_test_cpu(cpu, cpu_callin_mask)) {
>> - /* number CPUs logically, starting from 1 (BSP is 0)
>> */
>> - pr_debug("OK.\n");
>> - printk(KERN_INFO "CPU%d: ", cpu);
>> - print_cpu_info(&cpu_data(cpu));
>> - pr_debug("CPU has booted.\n");
>> - } else {
>> + if (cpumask_test_cpu(cpu, cpu_callin_mask))
>> + pr_debug("CPU%d: has booted.\n", cpu);
>> + else {
>> boot_error = 1;
>> if (*((volatile unsigned char *)trampoline_base)
>> == 0xA5)
>> /* trampoline started but...? */
>> - printk(KERN_ERR "Stuck ??\n");
>> + pr_err("CPU%d: Stuck ??\n", cpu);
>> else
>> /* trampoline code not run */
>> - printk(KERN_ERR "Not responding.\n");
>> + pr_err("CPU%d: Not responding.\n", cpu);
>> if (apic->inquire_remote_apic)
>> apic->inquire_remote_apic(apicid);
>> }
>> @@ -1291,14 +1306,16 @@
>> 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 (system_state == SYSTEM_RUNNING)
>> + pr_info("CPU %u is now offline\n", cpu);
>> +
>> if (1 == num_online_cpus())
>> alternatives_smp_switch(0);
>> return;
>> }
>> msleep(100);
>> }
>> - printk(KERN_ERR "CPU %u didn't die...\n", cpu);
>> + pr_err("CPU %u didn't die...\n", cpu);
>> }
>>
>> void play_dead_common(void)
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at http://www.tux.org/lkml/
>>
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2010-01-19 15:22 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-18 0:22 [PATCH 0/5] Limit console output by suppressing repetitious messages Mike Travis
2009-11-18 0:22 ` [PATCH 1/5] x86: Limit the number of processor bootup messages Mike Travis
2009-11-18 2:45 ` Yinghai Lu
2009-11-18 17:43 ` Mike Travis
2009-11-26 9:15 ` Ingo Molnar
2009-11-27 21:29 ` [PATCH] " Mike Travis
2009-11-18 0:22 ` [PATCH 2/5] INIT: Limit the number of per cpu calibration " Mike Travis
2009-11-26 9:55 ` [tip:timers/core] timers, init: " tip-bot for Mike Travis
2009-11-18 0:22 ` [PATCH 3/5] firmware: Limit the number of per cpu firmware messages during bootup Mike Travis
2009-11-18 0:22 ` [PATCH 4/5] sched: Limit the number of scheduler debug messages Mike Travis
2009-11-26 9:55 ` [tip:sched/core] " tip-bot for Mike Travis
2009-11-18 0:22 ` [PATCH 5/5] x86: Limit number of per cpu TSC sync messages Mike Travis
2009-11-26 9:55 ` [tip:x86/debug] " tip-bot for Mike Travis
-- strict thread matches above, loose matches on Subject: below --
2009-12-11 1:19 [PATCH] x86: Limit the number of processor bootup messages Mike Travis
2010-01-19 5:07 ` Xiaotian Feng
2010-01-19 15:22 ` Mike Travis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox