Re: [PATCH 3/7] INIT: Limit the number of per cpu INIT bootupmessages

From: David Rientjes
Date: Thu Nov 12 2009 - 16:07:09 EST


On Thu, 12 Nov 2009, Mike Travis wrote:

> Limit the number of per cpu INIT messages when system is booting to
> prevent clogging up the console output with repetitious messages.
>

Needs a better changelog. What did you do to effect that change? It
looks like you're only emitting certain messages from the boot cpu.

> Signed-off-by: Mike Travis <travis@xxxxxxx>
> ---
> init/calibrate.c | 22 +++++++++++++---------
> kernel/cpu.c | 5 ++---
> 2 files changed, 15 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;
> + bool boot_cpu = (smp_processor_id() == 0);
>
> 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 (boot_cpu)
> + pr_info("Calibrating delay loop (skipped) "
> + "preset value.. ");

Same comment as before about breaking printk strings into multiple lines
when not broken at '\n'. All the other patches your series look good
after this, however.

> + } else if ((boot_cpu) && lpj_fine) {

Parentheses around boot_cpu?

> 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 (boot_cpu)
> + pr_info("Calibrating delay using timer "
> + "specific routine.. ");
> } else {
> loops_per_jiffy = (1<<12);
>
> - printk(KERN_INFO "Calibrating delay loop... ");
> + if (boot_cpu)
> + pr_info("Calibrating delay loop... ");
> while ((loops_per_jiffy <<= 1) != 0) {
> /* wait for "start of" clock tick */
> ticks = jiffies;
> @@ -170,7 +173,8 @@
> loops_per_jiffy &= ~loopbit;
> }
> }
> - printk(KERN_CONT "%lu.%02lu BogoMIPS (lpj=%lu)\n",
> + if (boot_cpu)
> + pr_cont("%lu.%02lu BogoMIPS (lpj=%lu)\n",
> loops_per_jiffy/(500000/HZ),
> (loops_per_jiffy/(5000/HZ)) % 100, loops_per_jiffy);
> }
> --- 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;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/