From: "Dave Young" <hidave.darkstar@gmail.com>
To: "Randy Dunlap" <randy.dunlap@oracle.com>
Cc: akpm <akpm@linux-foundation.org>,
"Dave Jones" <davej@codemonkey.org.uk>,
"Linux Kernel" <linux-kernel@vger.kernel.org>,
"Thomas Gleixner" <tglx@linutronix.de>
Subject: Re: boot_delay broken ?
Date: Wed, 27 Feb 2008 10:01:43 +0800 [thread overview]
Message-ID: <a8e1da0802261801m4bd05b32rc8e97bc0f83773ff@mail.gmail.com> (raw)
In-Reply-To: <20080226093323.71ae516b.randy.dunlap@oracle.com>
On Wed, Feb 27, 2008 at 1:33 AM, Randy Dunlap <randy.dunlap@oracle.com> wrote:
>
> On Tue, 26 Feb 2008 17:09:48 +0800 Dave Young wrote:
>
> > On Tue, Feb 26, 2008 at 01:59:31PM +0800, Dave Young wrote:
> > > On Tue, Feb 26, 2008 at 1:48 PM, Dave Young <hidave.darkstar@gmail.com> wrote:
> > > > On Tue, Feb 26, 2008 at 1:22 PM, Randy Dunlap <randy.dunlap@oracle.com> wrote:
> > > > > On Mon, 25 Feb 2008 10:14:36 +0800 Dave Young wrote:
> > > > >
> > > > > > On Sun, Feb 24, 2008 at 8:46 AM, Dave Jones <davej@codemonkey.org.uk> wrote:
> > > > > > > The boot_delay switch seems to be behaving strangely in the
> > > > > > > current -git. Setting it to =10 makes the output 'bursty'
> > > > > > > it becomes slow for some printk's whilst others scroll by
> > > > > > > at regular speed.
> > > > > > > Setting it any higher than that seems to make it pause for
> > > > > > > a really long time before it outputs any text at all.
> > > > > >
> > > > > > On my side there's this issue for a long time
> > > > > > http://lkml.org/lkml/2007/8/8/79
> > > > >
> > > > > [http://marc.info/?l=linux-kernel&m=118655896515049&w=2]
> > > > >
> > > > > You asked questions and they were answered. Perhaps you didn't like
> > > > > the answers.
> > > >
> > > > No, I like it. Thanks.
> > > >
> > > > But I still want to know why mdelay can not be used.
> > > > is it not available for all archs or something else?
> > > >
> > > >
> > > > >
> > > > > Here's a question for you. What kernel boot options did you use?
> > > > > Specifically, for lpj= and boot_delay= ?
> > > >
> > > > I tried boot_delay=100 and boot_delay=200 without lpj set, The result
> > > > was really slow. It was better with lpj copied from dmesg, but was
> > > > still slower then mdelay.
> > >
> > > Especially at the very beginning after the message "Booting the kernel",
> > > I need to wait several minutes to see the afterwards messages
> > >
> > > >
> > > > I think we can firstly use preset lpj, after delay calibrating just
> > > > use the system lpj
> > > >
> > > >
> > > >
> > > > >
> > > > > > >
> > > > > > > x86 timer changes perhaps ?
> > > > >
> > > > >
> > > > > ---
> > > > > ~Randy
> > > > >
> > > >
> >
> > How about use loops_per_jiffy as following? With this patch at least
> > for me the very long delay at the very begining does not occur.
> >
> > kernel/printk.c | 15 ++++-----------
> > 1 file changed, 4 insertions(+), 11 deletions(-)
> >
> > diff -upr linux/kernel/printk.c linux.new/kernel/printk.c
> > --- linux/kernel/printk.c 2008-02-26 16:54:23.000000000 +0800
> > +++ linux.new/kernel/printk.c 2008-02-26 16:59:02.000000000 +0800
> > @@ -173,24 +173,14 @@ __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 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;
> > -
> > get_option(&str, &boot_delay);
> > 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);
> > + printk(KERN_DEBUG "boot_delay: %u\n", boot_delay);
> > return 1;
> > }
> > __setup("boot_delay=", boot_delay_setup);
> > @@ -199,6 +189,9 @@ static void boot_delay_msec(void)
> > {
> > unsigned long long k;
> > unsigned long timeout;
> > + unsigned long long printk_delay_msec;
> > +
> > + printk_delay_msec = (unsigned long long)loops_per_jiffy / 1000 * HZ;
> >
> > if (boot_delay == 0 || system_state != SYSTEM_BOOTING)
> > return;
> > --
>
> Hi Dave,
>
> That might work, but IMO it requires someone to audit all
> architectures to make sure that loops_per_jiffy has been calibrated
> at that point in time
>(as I mentioned in http://lkml.org/lkml/2007/8/11/153).
Sorry for missing your words about this.
>
> I didn't do that and you said that you tested i386 only.
>
> Maybe you can get Andrew to merge it into -mm for testing...
Andrew, what's your opinon?
>
> However, setting boot_delay=N without setting lpj=M is just not
> advisable. The Kconfig help text for BOOT_PRINTK_DELAY tries to
> say that. Maybe it needs to be stronger?
I think it's enough now.
I tested boot_delay yestoday, and found the result is different with
before version.
Even with lpj preset the delay is very slow, 5-10 seconds for every printk.
Maybe this is what davej said.
I will do some more test and hack about this today.
>
> It is likely that you would also need to use "lpj=M" to preset
> the "loops per jiffie" value.
> See a previous boot log for the "lpj" value to use for your
> system, and then set "lpj=M" before setting "boot_delay=N".
>
>
> ---
> ~Randy
>
next prev parent reply other threads:[~2008-02-27 2:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-24 0:46 Dave Jones
2008-02-25 2:14 ` Dave Young
2008-02-26 5:22 ` Randy Dunlap
2008-02-26 5:48 ` Dave Young
2008-02-26 5:59 ` Dave Young
2008-02-26 9:09 ` Dave Young
2008-02-26 17:33 ` Randy Dunlap
2008-02-27 2:01 ` Dave Young [this message]
2008-02-28 8:03 ` Dave Young
2008-02-27 9:19 ` Pavel Machek
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=a8e1da0802261801m4bd05b32rc8e97bc0f83773ff@mail.gmail.com \
--to=hidave.darkstar@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=davej@codemonkey.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=randy.dunlap@oracle.com \
--cc=tglx@linutronix.de \
/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
Powered by JetHome