How Kernel Hackers Boosted the Speed of Desktop Linux 380
chromatic writes "Kernel hackers Arjan van de Ven and Auke Kok showed off Linux booting in five seconds at last month's Linux Plumbers Conference. Arjan and other hackers have already improved the Linux user experience by reducing power consumption and latency. O'Reilly News interviewed him about his work on improving the Linux experience with PowerTOP, LatencyTOP, and Five-Second Boot."
Should lead to possibly great advertisements (Score:5, Insightful)
Does it matter? (Score:4, Insightful)
I see a lot of comments on the LWN article of people talking about starting services after the user sees the desktop as cheating. However, I ask, does this really all matter. I'm not sure how everyone else uses their computer but I only need to boot my Linux machine about once every 30-60 days. I don't need to dual boot like I did back in say 2002 and comparitively, the amount of time it takes for Linux and X to start up are practically irrelivent. I can imagine laptop users may feel much differently about this, but I thought that was the point of being able to suspend/hibernate.
One thing that worries me is that a focus on ensuring a quick boot at the expense of a potentially less stable system is not a good thing. Fortunately however quick booting is not something that Linux requires, its something that distributions can decide to do or not, which is one of the strengths of the open source/Linux way.
Re:Does it matter? (Score:5, Insightful)
Being able to boot in NN seconds isn't so impressive when you look at the incompatibilities it creates.
On my networks, the servers connect to the DHCP server and get not only an IP back, but also the name of NIS servers, who in turn returns (among other things) autofs maps which are used to mount the home directories as well as providing login authentication. The xdm login window returns a list of currently available X servers.
In other words, there are reasons why things run in the order they run, and any deviation will cause things to stop working.
Improving things are fine, but not when it's at the expense of current and well-known functionality.
Re:Should lead to possibly great advertisements (Score:5, Insightful)
The only issue is that they had to cut some corners to make this work. Axing sendmail? Ok, I understand that (I think was arguing that 10 years ago -- still don't wonder why that's on by default in the desktop distributions). But "The 'done booting' time did not include bringing up the network"? Um, ok... no. With the proliferation of devices solely used to read information from networks (Netbooks, those "quick-loading" Linux apps some laptop manufacturers are including so people can check their email, etc.) accessing the network is one of the main purposes for turning on the machine in the first place. It would royally piss people off to have a quick loading screen, log in and then see "Hold up, still starting up the network". (Just as frustrating as starting a Windows or Mac, getting to the desktop and still waiting while services and programs are loaded).
Come to think of it, what people really need to do is take a good look at modern OSes and determine EXACTLY what still needs to be there and what's cruft. Some of the daemons/services we're launching made sense 15-20 years ago. Does the fax daemon really need to start on my Mac? Does the Group Policy Client need to be started on my Vista box when I'm not on a domain? There's lots of stuff that at one point probably made sense to someone but now is just extraneous.
Re:Yeah but... (Score:2, Insightful)
desktop OSes are so complex that using re-flashable ROM adds a great deal of complexity and cost to the design.
Flash is almost dirt cheap. $10 buys you more Flash memory than most systems have RAM. Just save the state of a freshly booted OS in Flash and when the computer starts, load just what you need to access flash and handle page faults, then start as if you've already loaded everything into RAM and start copying from Flash to RAM. Whenever a page fault occurs, load that page from Flash next. This way you don't need to wait until everything is copied to RAM.
Re:Does it matter? (Score:3, Insightful)
... you can't take advantage of all of these improvements. Why penalize everyone who doesn't use NIS and autofs?
Re:Should lead to possibly great advertisements (Score:5, Insightful)
... but an OEM can. (If they were so inclined.)
Re:Does it matter? (Score:5, Insightful)
On my networks, the servers connect to the DHCP server and get not only an IP back, but also the name of NIS servers, who in turn returns (among other things) autofs maps which are used to mount the home directories as well as providing login authentication.
What you describe is similar to what Windows calls "domain authentication". Not every computer logs on to a domain, especially in the home or home office environment where a fast boot is paramount.
The xdm login window returns a list of currently available X servers.
Then have it refresh the list whenever a network interface comes up.
Re:On an old Pentium III laptop... (Score:2, Insightful)
Re:Does it matter? (Score:4, Insightful)
so you are saying that you would rather stare at a hung boot in text mode instead of having the possibility of working in offline mode in X?
that does not make sense at all :)
for network-client setups like you describe, we should still start X immediately and if the network fails or is slow, at least provide some interaction with the system (work offline, nudge network with login attempt etc).
Re:Should lead to possibly great advertisements (Score:5, Insightful)
Sendmail's main purpose in the typical Linux desktop configuration (say, Fedora) is delivering logwatch output to root. [Logwatch attempts to distill the important stuff from system log files.]
But sendmail can be started lazily (in the background) so as not to slow the boot. Or sendmail can be replaced with a lighter weight smtp daemon. Truly though, logwatch-by-email should die for non-enterprise desktops. It's so 1980s it just hurts.
IMHO logwatch should be replaced by some kind of graphical notification widget which requires authentication to actually view the details, since they can be sensitive. As it is, I haven't read my logwatch emails in months, but if SMART is complaining about an immanent disk failure I'd *really* like to know.
Re:Does it matter? (Score:3, Insightful)
How ironic, with all the Vista bashing that tends to go on in threads like these. Vista boots relatively quickly, and hasn't been powered down for me for weeks since suspend/wake works perfectly. But at least someone, somewhere can boot linux in 5 seconds.
Agreed. The only time I reboot my laptop is after updates/new software install. IMO the power management in Vista is the best I've seen.
Re:Should lead to possibly great advertisements (Score:3, Insightful)
Actually Vista with 4 Gigs of RAM boots pretty quickly. It's once it's up that it is slow.
Microsoft seems to have performed a bit of trickery to make you perceive that Vista boots quickly. The desktop on my wife's Vista laptop appears fairly quickly but it is simply unusable for a couple more minutes. This is different from XP which is fairly usable as soon as (well, shortly after) the desktop appears. It's rather like the desktop is the bootsplash on Vista.
Re:Does it matter? (Score:1, Insightful)
Yes, it matters. The iRex Iliad eBook reader, for example, is a linux box, and you boot it up quite a lot.
Boot time is around 50 seconds. Thats a looooong time to open a book - one of the biggest complaints the users have.
While this can be mitigated somewhat by getting suspend working, you're left with once-a-week or so, hiding from society while your embarassing techno-lump wakes up. In any case, this particular hardware does not support suspend (we're told, in part, due to a proprietary USB driver. grrr)
5 second boot time would change how you use the device. I can see this being the case for all kinds of devices from netbooks down; maybe someone else has an itch to scratch to get this working with desktops and servers.
Re:Should lead to possibly great advertisements (Score:5, Insightful)
Re:If you really... (Score:2, Insightful)
Linux runs many embedded devices; some of them may wish to boot quickly.
Re:Yeah but... (Score:3, Insightful)
It's still possible to create such fast boot times using ROM. Especially with re-flashable ROM. These sorts of boot times are seen in systems like Game Consoles.
Uhh, if I turn on my Mac Pro and my Xbox 360 at the same time, I'm up and running with OS X a few seconds before the 360 starts to load the game. I for one hope my computer DOESN'T have boot times like a console.
Booting is overrated (Score:3, Insightful)
Re:Does it matter? (Score:3, Insightful)
If you ever end up with an uptime of more than 5 weeks in Vista, you should worry. It means you haven't installed the latest patches.
Re:Should lead to possibly great advertisements (Score:2, Insightful)
What I'd be curious to know is if there's a way to prevent it from giving me a damn desktop if I can't use it yet... I wouldn't mind sitting at an hourglass or green spinning circle for 8 extra seconds if it means Windows won't taunt me with a GUI I cannot use
Re:Should lead to possibly great advertisements (Score:3, Insightful)
But "The 'done booting' time did not include bringing up the network"? Um, ok... no.
Consider that "bringing up the network" generally involves communicating with at least one other device. You can't really call it a metric of OS boot time when merely plugging into a different network (or none at all) might change the result.
Come to think of it, what people really need to do is take a good look at modern OSes and determine EXACTLY what still needs to be there and what's cruft.
I would much prefer simply cutting them out of the boot process, or making a smarter boot process.
For example: Maybe I do want a MySQL server running. But I certainly don't want you to delay my login screen while I wait for it to start. I probably don't want it eating up RAM on a desktop, either, until something needs it.
A good implementation: X11 on OS X. Granted, there are many things not to like about it, but one thing to love is the fact that it only starts once you actually attempt to run an X app.
Re:Should lead to possibly great advertisements (Score:3, Insightful)
A couple of things that have changed, from the top of my head:
- Those old machines had an OS dedicated to support exactly the hardware that was shipped. OTOH, Linux distros are usually generic, and detect hardware on boot.
- There's a huge difference between a BASIC interpreter and a full-fledged multi-user OS with networking, GUI, etc.
- PC hardware spends a lot of time during boot before actually handing control to the software. Server hardware is often a lot worse.
- The code involved in booting those old machines was probably written by Real Programmers, who knew the ins and outs of the hardware they were programming for. It's probably horrible to maintain, but ridiculously fast. By contrast, most of the code involved in booting your Linux distro is written in a variety of languages, by a whole lot of people, few of whom are Real Programmers, and it's probably optimized for genericity and maintainability, rather than efficiency.
Having said all that, you _can_ boot Linux ridiculously fast. I used to have a 486 where the boot process basically consisted of (1) POST (2) Load GRUB (3) Load kernel (4) Run init (5) Run login. Pretty much a normal boot process. What was special about it is that the kernel had all required modules compiled in, and nothing else. init (IIRC) only spawned a single tty and ran login. And both init and login were BusyBox [busybox.net] statically linked against dietlibc [www.fefe.de]. From GRUB to login prompt took less than 5 seconds, IIRC. You could further improve on this by foregoing the BIOS in favor of something like coreboot [linuxbios.org].
Re:Should lead to possibly great advertisements (Score:3, Insightful)
we already boot in seconds. the totaly size of the data read from disk at boot is UNDER 100mb total on our 5-second boot systems.
you don't provide a solution to speeding things up, only an alternative that works in limited cases. reinventing hibernate at best.