The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: David Daney <ddaney@caviumnetworks.com>,
	Sameer Nanda <snanda@chromium.org>,
	ext-phil.2.carmody@nokia.com, Tim.Deegan@citrix.com,
	jbeulich@novell.com, snanda@google.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] init: skip calibration delay if previously done
Date: Fri, 03 Jun 2011 15:00:09 -0700	[thread overview]
Message-ID: <1307138409.14598.52.camel@Joe-Laptop> (raw)
In-Reply-To: <20110603144540.d182c231.akpm@linux-foundation.org>

On Fri, 2011-06-03 at 14:45 -0700, Andrew Morton wrote:
> But the whole thing is a bit weird.  Does this look better?
> Make these messages more gramatically pleasing, more consistent and remove
> strange ellipses.

or maybe something like this:

 init/calibrate.c |   34 ++++++++++++++++++++--------------
 1 files changed, 20 insertions(+), 14 deletions(-)

diff --git a/init/calibrate.c b/init/calibrate.c
index cfd7000..827a45c 100644
--- a/init/calibrate.c
+++ b/init/calibrate.c
@@ -246,32 +246,38 @@ recalibrate:
 	return lpj;
 }
 
+static DEFINE_PER_CPU(unsigned long, cpu_loops_per_jiffy) = { 0 };
+
 void __cpuinit calibrate_delay(void)
 {
+	int this_cpu = smp_processor_id();
 	static bool printed;
+	const char *msg;
 
-	if (preset_lpj) {
+	if (per_cpu(cpu_loops_per_jiffy, this_cpu)) {
+		loops_per_jiffy = per_cpu(cpu_loops_per_jiffy, this_cpu);
+		msg = " CPU previously calibrated";
+	} else if (preset_lpj) {
 		loops_per_jiffy = preset_lpj;
-		if (!printed)
-			pr_info("Calibrating delay loop (skipped) "
-				"preset value.. ");
+		msg = " preset value";
 	} else if ((!printed) && lpj_fine) {
 		loops_per_jiffy = lpj_fine;
-		pr_info("Calibrating delay loop (skipped), "
-			"value calculated using timer frequency.. ");
+		msg = " using timer frequency";
 	} else if ((loops_per_jiffy = calibrate_delay_direct()) != 0) {
-		if (!printed)
-			pr_info("Calibrating delay using timer "
-				"specific routine.. ");
+		msg = " using timer specific routine";
 	} else {
-		if (!printed)
-			pr_info("Calibrating delay loop... ");
+		pr_info("Calibrating delay loop...\n");
 		loops_per_jiffy = calibrate_delay_converge();
+		per_cpu(cpu_loops_per_jiffy, this_cpu) = loops_per_jiffy;
+		msg = "";
 	}
-	if (!printed)
-		pr_cont("%lu.%02lu BogoMIPS (lpj=%lu)\n",
+
+	if (!printed) {
+		pr_info("Delay loop calibration:%s %lu.%02lu BogoMIPS (lpj=%lu)\n",
+			msg,
 			loops_per_jiffy/(500000/HZ),
 			(loops_per_jiffy/(5000/HZ)) % 100, loops_per_jiffy);
 
-	printed = true;
+		printed = true;
+	}
 }



  reply	other threads:[~2011-06-03 22:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-24 23:19 [PATCH] init: skip calibration delay if previously done Sameer Nanda
2011-06-03 21:00 ` Andrew Morton
2011-06-03 21:08   ` David Daney
2011-06-03 21:45     ` Andrew Morton
2011-06-03 22:00       ` Joe Perches [this message]
2011-06-03 22:15       ` Sameer Nanda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1307138409.14598.52.camel@Joe-Laptop \
    --to=joe@perches.com \
    --cc=Tim.Deegan@citrix.com \
    --cc=akpm@linux-foundation.org \
    --cc=ddaney@caviumnetworks.com \
    --cc=ext-phil.2.carmody@nokia.com \
    --cc=jbeulich@novell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=snanda@chromium.org \
    --cc=snanda@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox