LWN.net Logo

LPC: Booting Linux in five seconds

LPC: Booting Linux in five seconds

Posted Sep 22, 2008 19:20 UTC (Mon) by jzbiciak (✭ supporter ✭, #5246)
In reply to: LPC: Booting Linux in five seconds by flewellyn
Parent article: LPC: Booting Linux in five seconds

In my mind, suspend is something of a hack to get around awful boot times, and it's still flaky for some users. It also doesn't help you at all when you have to install OS updates that require a reboot.

Sure, suspend has other benefits--you can keep all your applications open where you left off--but starting from a clean system often provides a better user experience, unfortunately. (Fortunately, some of the bigger culprits here, such as Firefox, have fixed their memory leaks. The Firefox-2-GMail leak really sucked.)


(Log in to post comments)

LPC: Booting Linux in five seconds

Posted Sep 22, 2008 19:25 UTC (Mon) by flewellyn (subscriber, #5047) [Link]

I suppose so. Even so, I'm wondering "what about regular runtime performance? Any benefit there?"

LPC: Booting Linux in five seconds

Posted Sep 22, 2008 19:55 UTC (Mon) by Yorick (subscriber, #19241) [Link]

Any serious effort to bring down boot times will inevitably scrutinise each and every daemon and service started and likely do away with a few less essential ones. As a side-effect, that may very well make a system use less resources and be more stable and secure once the system has been brought up.

I also believe that faster boots give us happier and more productive kernel hackers, because they reboot more often than anyone else. That alone makes it worth the trouble.

LPC: Booting Linux in five seconds

Posted Sep 23, 2008 7:40 UTC (Tue) by michaeljt (subscriber, #39183) [Link]

> Any serious effort to bring down boot times will inevitably scrutinise
> each and every daemon and service started and likely do away with a few
> less essential ones.

Or profile how much users of a system use a particular service and start it by default if they use it a lot, or on demand if they use it occasionally.

LPC: Booting Linux in five seconds

Posted Sep 22, 2008 19:58 UTC (Mon) by jzbiciak (✭ supporter ✭, #5246) [Link]

Probably not, as it stands.

I suppose a complex application that takes a long time to start in its own right (OpenOffice, I'm looking at you) might take some hints from the methodology and try to parallelize and optimize its startup tasks. I'm not sure how far you get with a userspace app like that though.

I suppose if you have an embedded device that actually gets powered off and on semi-regularly (media player, cell phone), this work directly impacts the user experience. Those devices could actually boot from scratch rather than dumping state to flash for suspend when they power off. That extends flash lifetime, and it makes startup and shutdown quicker.

My current cellphone takes a good 15 seconds to boot. Booting in 5 would be a noticeable improvement. Granted, I only shut it off when I'm flying somewhere or when the battery gets obnoxiously low, but still, it could make you a favorite with the jet setters. Seeing as there's already interesting Linux distributions running on OpenMoko, I'm sure there's plenty of opportunity for cross-pollination. (Check out this one: http://mobile.slashdot.org/article.pl?sid=08/09/21/1730256 )

LPC: Booting Linux in five seconds

Posted Sep 22, 2008 20:10 UTC (Mon) by flewellyn (subscriber, #5047) [Link]

Of course, I didn't even think of the impact for an embedded environment. You're right, there's a lot of value there for devices that need to turn on and off regularly.

LPC: Booting Linux in five seconds

Posted Sep 23, 2008 3:26 UTC (Tue) by mrshiny (subscriber, #4266) [Link]

Also, suspending is not the same as booting when it comes to your
applications. I can suspend my notebook by closing its lid, and when I
come back every single program is exactly where I left it (except for
those that depend on network sockets). This is way better than shutting
down and rebooting; even apps that support session management don't do
that well compared to a nice suspend/resume.

LPC: Booting Linux in five seconds

Posted Sep 23, 2008 0:09 UTC (Tue) by rlk (guest, #47505) [Link]

I use suspend as much (or more) because I want to keep everything open with the running state than because of the reboot time. For example, I often have a lot of emacs buffers and xterm windows, and I want that state preserved for as long as possible. I've been known to keep login sessions going for months on end.

With Session Manager, the Firefox annoyances aren't that big of a deal; it's the other stuff I want kept around.

Suspend/resume does not eliminate the need for faster boot time, or vice versa.

suspend vs. reboot

Posted Sep 23, 2008 6:31 UTC (Tue) by Cato (subscriber, #7643) [Link]

I greatly prefer being able to suspend/resume - you have all the state of your applications, down to cursor position in documents, history and scrollback in shells, etc. While Linux's session management is very nice it can't replicate all this, so faster boot doesn't help as much as getting suspend working - I usually don't bother trying to make it work as it's quite a hassle compared to hibernate.

I don't find memory leaks an issue these days - Firefox still crashes enough (due to plugins mostly) that it clears out any leaks in any case.

LPC: Booting Linux in five seconds

Posted Sep 23, 2008 13:29 UTC (Tue) by lbt (subscriber, #29672) [Link]

> In my mind, suspend is something of a hack to get around awful boot times,
> and it's still flaky for some users. It also doesn't help you at all when
> you have to install OS updates that require a reboot.

OK - that's your use...

*I* have 6 virtual desktops, eg:
1 with email, a browser window with 15-20 ever changing tabs,
a dev desktop or 2 in various states of compile/dev for multiple projects
an 'office' desktop with maybe OO Writer or Calc or QCAD or...
an admin desktop with windows to various boxen

I have a continually logged on experience interrupted by phone calls, sleep, food, social life, holidays etc - but it's nice to save power at night or when I go for food or go out so I want to hibernate (and I do - I only login/reboot when I choose to upgrade the kernel)

For those who argue that each app should do 'restore state' - why? Debian has what, 22,000 packages many of which would need to be able to restore state. Or we could use hibernate and get them all for free... Hmmm hard choice...

As for "install OS updates that require a reboot." - are you on Linux? This just doesn't happen with any meaningful frequency.

LPC: Booting Linux in five seconds

Posted Sep 23, 2008 16:48 UTC (Tue) by bronson (subscriber, #4806) [Link]

Are you talking about suspend or hibernate? Resuming from suspsend takes about 9 seconds on my Thinkpad T42p, while resuming from hibernate takes 1.5 mins. This is unfortunate because cold boot takes less than a minute... I tend to suspend/resume a lot and never ever hibernate.

When Linux supports process suspend/resume, hopefully resuming from hibernate becomes:
- boot in 5 secs
- restore your suspended apps

I can't wait for containerization to hit.

LPC: Booting Linux in five seconds

Posted Sep 23, 2008 18:55 UTC (Tue) by jwb (guest, #15467) [Link]

Why does your resume from suspend take so long? On my ThinkPad it takes less than one second.

LPC: Booting Linux in five seconds

Posted Sep 23, 2008 20:18 UTC (Tue) by bronson (subscriber, #4806) [Link]

No idea... The CD-ROM drive spins up (no disk in it though), there's some beeping from the speaker, after 3 seconds the backlight turns on, after 5 it switches to a real video mode, and it spends the last second or so drawing the password dialog.

I don't mind too much, 8 seconds is tolerable. At least it never crashes!

LPC: Booting Linux in five seconds

Posted Sep 25, 2008 1:56 UTC (Thu) by deleteme (guest, #49633) [Link]

That's awfully fast, it's more like 1.5 - 3.5 seconds here. The disks starts to spin the screenblinks and take a while to become something usefull-

LPC: Booting Linux in five seconds

Posted Sep 25, 2008 2:49 UTC (Thu) by jwb (guest, #15467) [Link]

Well maybe you're right, because I just took a video of my computer waking from sleep and it takes 6 seconds. However, the time between when the backlight comes on and when the unlock dialog appears is a split second. I guess I was mentally attributing the remainder of the time to the hardware/BIOS.

Which brings us back around to the article. The five seconds of booting does not include the time between power-on and when GRUB hands off to Linux.

LPC: Booting Linux in five seconds

Posted Sep 26, 2008 2:12 UTC (Fri) by njs (guest, #40338) [Link]

I thought restore from hibernate spent most of its time reading the (potentially multi-gigabyte) memory image from disk. Booting doesn't need to load 500 megabytes of firefox into memory, etc.; is there some reason to think that restoring your individual apps would be faster than restoring the hibernate memory image?

LPC: Booting Linux in five seconds

Posted Sep 26, 2008 17:09 UTC (Fri) by bronson (subscriber, #4806) [Link]

Because -- in theory -- you wouldn't have to restore every application, (don't worry about freezing the memory used by all those useless panel apps). And the apps themselves could be smarter (Firefox wouldn't try to persist its in-memory caches). Crash-only apps could just be terminated and re-launched (IM clients, mail clients, etc), no need to write them all out.

I admit, it's all speculation at this point. :)

LPC: Booting Linux in five seconds

Posted Sep 23, 2008 17:04 UTC (Tue) by jzbiciak (✭ supporter ✭, #5246) [Link]

Ubuntu seems to push kernel updates that want a reboot every few weeks. That said, I usually push it to a couple months before I do reboot.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds