mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dave Young <hidave.darkstar@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Ingo Molnar <mingo@elte.hu>,
	linux-kernel@vger.kernel.org,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: [PATCH] printk boot_delay: use loops_per_msec instead of  printk_delay_msec
Date: Tue, 16 Jun 2009 17:02:24 +0800	[thread overview]
Message-ID: <a8e1da0906160202r7124b8a7x29ace04cd910df52@mail.gmail.com> (raw)

Sorry, should post this firstly because the previous printk_delay
patch depends on this,
please review, thanks.
--

Use loops_per_msec instead of printk_delay_msec for boot printk delay.

Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
---
kernel/printk.c |   10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)

--- linux-2.6.orig/kernel/printk.c	2009-06-15 10:53:10.000000000 +0800
+++ linux-2.6/kernel/printk.c	2009-06-15 13:17:13.000000000 +0800
@@ -198,12 +198,11 @@ __setup("log_buf_len=", log_buf_len_setu
 #ifdef CONFIG_BOOT_PRINTK_DELAY

 static unsigned int boot_delay; /* msecs delay after each printk
during bootup */
-static unsigned long long printk_delay_msec; /* per msec, based on
boot_delay */
+static unsigned long long loops_per_msec;

 static int __init boot_delay_setup(char *str)
 {
 	unsigned long lpj;
-	unsigned long long loops_per_msec;

 	lpj = preset_lpj ? preset_lpj : 1000000;	/* some guess */
 	loops_per_msec = (unsigned long long)lpj / 1000 * HZ;
@@ -212,10 +211,9 @@ static int __init boot_delay_setup(char
 	if (boot_delay > 10 * 1000)
 		boot_delay = 0;

-	printk_delay_msec = loops_per_msec;
 	printk(KERN_DEBUG "boot_delay: %u, preset_lpj: %ld, lpj: %lu, "
-		"HZ: %d, printk_delay_msec: %llu\n",
-		boot_delay, preset_lpj, lpj, HZ, printk_delay_msec);
+		"HZ: %d, loops_per_msec: %llu\n",
+		boot_delay, preset_lpj, lpj, HZ, loops_per_msec);
 	return 1;
 }
 __setup("boot_delay=", boot_delay_setup);
@@ -228,7 +226,7 @@ static void boot_delay_msec(void)
 	if (boot_delay == 0 || system_state != SYSTEM_BOOTING)
 		return;

-	k = (unsigned long long)printk_delay_msec * boot_delay;
+	k = (unsigned long long)loops_per_msec * boot_delay;

 	timeout = jiffies + msecs_to_jiffies(boot_delay);
 	while (k) {

             reply	other threads:[~2009-06-16  9:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-16  9:02 Dave Young [this message]
2009-06-23  5:55 ` Andrew Morton
2009-06-23 12:43   ` Dave Young

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=a8e1da0906160202r7124b8a7x29ace04cd910df52@mail.gmail.com \
    --to=hidave.darkstar@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=torvalds@linux-foundation.org \
    /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

all inboxes | Powered by JetHome®