* [PATCH] x86: Limit the number of processor bootup messages
@ 2009-12-11 1:19 Mike Travis
2009-12-12 0:15 ` [tip:x86/urgent] " tip-bot for Mike Travis
2010-01-19 5:07 ` [PATCH] " Xiaotian Feng
0 siblings, 2 replies; 5+ 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] 5+ messages in thread* [tip:x86/urgent] x86: Limit the number of processor bootup messages
2009-12-11 1:19 [PATCH] x86: Limit the number of processor bootup messages Mike Travis
@ 2009-12-12 0:15 ` tip-bot for Mike Travis
2010-01-19 5:07 ` [PATCH] " Xiaotian Feng
1 sibling, 0 replies; 5+ messages in thread
From: tip-bot for Mike Travis @ 2009-12-12 0:15 UTC (permalink / raw)
To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, travis, tglx
Commit-ID: 2eaad1fddd7450a48ad464229775f97fbfe8af36
Gitweb: http://git.kernel.org/tip/2eaad1fddd7450a48ad464229775f97fbfe8af36
Author: Mike Travis <travis@sgi.com>
AuthorDate: Thu, 10 Dec 2009 17:19:36 -0800
Committer: H. Peter Anvin <hpa@zytor.com>
CommitDate: Fri, 11 Dec 2009 15:16:00 -0800
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>
LKML-Reference: <4B219E28.8080601@sgi.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.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(-)
diff --git a/arch/x86/kernel/cpu/addon_cpuid_features.c b/arch/x86/kernel/cpu/addon_cpuid_features.c
index c965e52..468489b 100644
--- a/arch/x86/kernel/cpu/addon_cpuid_features.c
+++ b/arch/x86/kernel/cpu/addon_cpuid_features.c
@@ -74,6 +74,7 @@ void __cpuinit detect_extended_topology(struct cpuinfo_x86 *c)
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 @@ void __cpuinit detect_extended_topology(struct cpuinfo_x86 *c)
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
}
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index 7128b37..8dc3ea1 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -375,8 +375,6 @@ static void __cpuinit srat_detect_node(struct cpuinfo_x86 *c)
node = nearby_node(apicid);
}
numa_set_node(cpu, node);
-
- printk(KERN_INFO "CPU %d/0x%x -> Node %d\n", cpu, apicid, node);
#endif
}
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index c1afa99..0ee9a32 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -427,6 +427,7 @@ void __cpuinit detect_ht(struct cpuinfo_x86 *c)
#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 @@ void __cpuinit detect_ht(struct cpuinfo_x86 *c)
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 @@ void __cpuinit detect_ht(struct cpuinfo_x86 *c)
((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 @@ void __cpuinit cpu_init(void)
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);
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
index c900b73..9c31e8b 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -270,8 +270,6 @@ static void __cpuinit srat_detect_node(struct cpuinfo_x86 *c)
node = cpu_to_node(cpu);
}
numa_set_node(cpu, node);
-
- printk(KERN_INFO "CPU %d/0x%x -> Node %d\n", cpu, apicid, node);
#endif
}
diff --git a/arch/x86/kernel/cpu/mcheck/therm_throt.c b/arch/x86/kernel/cpu/mcheck/therm_throt.c
index 4fef985..1003ed4 100644
--- a/arch/x86/kernel/cpu/mcheck/therm_throt.c
+++ b/arch/x86/kernel/cpu/mcheck/therm_throt.c
@@ -339,8 +339,8 @@ void intel_init_thermal(struct cpuinfo_x86 *c)
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);
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 29e6744..678d0b8 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -671,6 +671,26 @@ static void __cpuinit do_fork_idle(struct work_struct *work)
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.
@@ -737,9 +757,8 @@ do_rest:
/* 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
@@ -788,21 +807,17 @@ do_rest:
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);
}
@@ -1293,14 +1308,16 @@ void native_cpu_die(unsigned int cpu)
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 related [flat|nested] 5+ 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
2009-12-12 0:15 ` [tip:x86/urgent] " tip-bot for Mike Travis
@ 2010-01-19 5:07 ` Xiaotian Feng
2010-01-19 15:22 ` Mike Travis
1 sibling, 1 reply; 5+ 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] 5+ messages in thread* Re: [PATCH] x86: Limit the number of processor bootup messages
2010-01-19 5:07 ` [PATCH] " Xiaotian Feng
@ 2010-01-19 15:22 ` Mike Travis
0 siblings, 0 replies; 5+ 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] 5+ messages in thread
* [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
0 siblings, 1 reply; 5+ 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] 5+ 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-26 9:15 ` Ingo Molnar
0 siblings, 1 reply; 5+ 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] 5+ 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-26 9:15 ` Ingo Molnar
2009-11-27 21:29 ` [PATCH] " Mike Travis
0 siblings, 1 reply; 5+ 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] 5+ 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; 5+ 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] 5+ messages in thread
end of thread, other threads:[~2010-01-19 15:22 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-11 1:19 [PATCH] x86: Limit the number of processor bootup messages Mike Travis
2009-12-12 0:15 ` [tip:x86/urgent] " tip-bot for Mike Travis
2010-01-19 5:07 ` [PATCH] " Xiaotian Feng
2010-01-19 15:22 ` Mike Travis
-- strict thread matches above, loose matches on Subject: below --
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-26 9:15 ` Ingo Molnar
2009-11-27 21:29 ` [PATCH] " Mike Travis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox