Slashdot Log In
Reducing Boot Time On a General Linux Distro
Posted by
timothy
on Tue Sep 30, 2008 10:34 AM
from the replace-the-disembarculator dept.
from the replace-the-disembarculator dept.
Linzer writes "In this blog entry, Fred Crozat (head of Mandriva's engineering team in France) explains in great detail how his team has been detecting and getting rid of bottlenecks in the boot process, from the early stages to loading the desktop environment, thus decreasing overall boot time. An informative tour of the nuts and bolts of the boot process and how they can be tinkered with: initrd, initscripts, udev, modprobe calls. The basic tool they use for performance analysis is bootchart, which produces a map of process information and resource utilization during boot. The final trick: preloading desktop environment files while waiting for the user to type her password."
Related Stories
[+]
How Kernel Hackers Boosted the Speed of Desktop Linux 380 comments
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."
[+]
Hardware: PC Makers Try To Pinch Seconds From Their Boot Times 399 comments
Some computers are never turned off, or at least rarely see any state less active than "standby," but others (for power savings or other reasons) need rebooting — daily, or even more often. The New York Times is running a short article which says that it's not just a few makers like Asus who are trying to take away some of the pain of waiting for computers, especially laptops, to boot up. While it's always been a minor annoyance to wait while a computer slowly grinds itself to readiness, "the agitation seems more intense than in the pre-Internet days," and manufacturers are actively trying to cut that wait down to a more bearable length. How bearable? A "very good system is one that boots in under 15 seconds," according to a Microsoft blog cited, and an HP source names an 18-month goal of 20-30 seconds.
This discussion has been archived.
No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
Full
Abbreviated
Hidden
Loading... please wait.
Interesting but how useful, really? (Score:4, Insightful)
Re:Interesting but how useful, really? (Score:5, Insightful)
Some people power down their computers at night.
Parent
Re:Interesting but how useful, really? (Score:5, Funny)
How can they sleep without the soothing fan noise?
Parent
Re:Interesting but how useful, really? (Score:5, Funny)
I have fanless computers, you insensitive clod!
Parent
Re: (Score:3)
Re:Interesting but how useful, really? (Score:4, Interesting)
Actually, a Cobalt Qube [wikipedia.org] with no fan because it runs cool enough to not need it. It does a fine job of powering IPCop [ipcop.org] on its old 250mhz MIPS processor, providing a firewall, SQUID, and NAT for the house, and only using a handful of watts while doing it.
Parent
Re: (Score:3, Funny)
You insensitive clod.
Re:Interesting but how useful, really? (Score:5, Funny)
My bedroom contains exactly three things that use electricity. The alarm clock, the waterbed heater, and the ceiling fan/light fixture.
So, what the wife uses is ... battery-powered?
Parent
Re:Interesting but how useful, really? (Score:4, Funny)
There is no wife/girlfriend, thankyouverymuch.
Parent
Re: (Score:3, Funny)
Re:Interesting but how useful, really? (Score:5, Funny)
You just call in a contractor as the project requires, eh?
Parent
Re:Interesting but how useful, really? (Score:5, Funny)
Parent
Re:Interesting but how useful, really? (Score:5, Insightful)
If their default linux setup doesn't complete boot-up before their finish their morning piss they have a problem that no guide will fix :-)
Parent
Re:Interesting but how useful, really? (Score:5, Interesting)
I used to have that problem. Drove me bananas. The problem wasn't fixed until I got a new computer. I did find a slightly better solution than rebooting, though. I used to keep a CLI window up. If the mouse failed, I'd unload the USBHID kernel modules, then reload them. I don't remember which modules in specific, but it did provide relief without rebooting.
Unfortunately, this was a fairly common issue with the Linux kernel. There was little interest in fixing it at the time, so you may just need new hardware. (It's possible that the issue was ignored because it was caused by poor USB implementations. Which would hopefully mean that newer hardware is unaffected.)
Parent
Re: (Score:3, Informative)
the cheapest solution is a $10 usb 2.0 controller. http://www1.pricewatch.com/public/info2.aspx?i=44&z=2988&ro=2&aid=32983822&u=http%3A%2F%2F3btech.net%2Fadaufopousb2.html [pricewatch.com]
since the motherboards usb is buggy, this $10 fix will solve the problem.
Re:Interesting but how useful, really? (Score:5, Insightful)
It's so buggy that Windows doesn't have a problem with it.
Seriously, I'm a huge Linux fan, I use it at work, I use it at home, I'm using it right now... but that's just ridiculous.
I don't have to keep a shell window open, as there are hot keys enough to get one (I don't reboot by hitting the button), but I'm not about to spend a penny on something Windows can handle just because Linux can't.
Parent
Re:Interesting but how useful, really? (Score:5, Informative)
The usb implementation is buggy. They threw in enough fixes till it roughly worked on Windows and then it was considered good enough to ship. That's why it doesn't work on Linux. I'm just wondering how you don't know this already. Surely you've heard of this happening before?
Parent
Re:Interesting but how useful, really? (Score:5, Insightful)
And yet, who does the average user blame? Their hardware or Linux? There is a certain threshold beyond which arguing is pointless. If something doesn't work, you're not hurting anyone except yourself by trying to deflect blame. (Rightly or not.) As a developer myself, that's a lesson I had to learn long ago.
Just some food for thought.
Parent
Re:Interesting but how useful, really? (Score:4, Informative)
The Linux developers doing the bulk of the work are paid.
Parent
Sounds like broken USB autosuspend (Score:4, Informative)
On Linux usb ports can be powered down to save power. However it turns out that many USB devices are broken and can't cope with being powered down. Now the question comes up what version of Linux are you using? If it's something older than 6 months then there's a good chance this has been fixed (the list of things allowed to be powered down has gone from a blacklist to a whitelist of large categories). See this commit talking about the kernel no longer powering anything down bar USB hubs [kernel.org] for some more details.
A very short term band aid might be to disable usb autosuspend on that device via /sys/ [debian.org].
Parent
ACPI whitelist? (Score:4, Insightful)
Just be sure not to use crappy software/hardware that doesn't support [sleep].
And pay multiple times over for return shipping when I find that one or more components of my computer don't come out of sleep properly. Or do you know of a good whitelist of makes and models of commodity PC hardware that have the fewest defects in their ACPI implementation?
Parent
Re:Interesting but how useful, really? (Score:5, Insightful)
Yes you are unusual.
I shut down my work PC when I leave at night. I shut down my laptop when I put it back into the case.
Netbooks are also shutdown when you put them away.
Even you might shutdown your PC to save some power if it didn't take very long to power it back up.
Parent
Re:Interesting but how useful, really? (Score:4, Funny)
FWIW: My laptop is dual boot, and I have both windows and ubuntu hibernating on the drive. (Shh, don't wake them.) I just select which one to boot from grub. Haven't had any problems with it since I've been doing this, about 2+ years or so.
Parent
Re:Interesting but how useful, really? (Score:5, Funny)
To the death or will first blood satisfy the honor of these OS's? And do the cellphone and PDA act as seconds?
Parent
Re: (Score:3, Interesting)
Shorter boot time. With s2disk you don't have to wait for the bios to POST, for the kernel to probe your devices, etc. Also, how well does this kde feature deal with terminal windows? If I'm editing something in vi in a terminal, is KDE smart enough to reopen the terminal window and start vi with the cursor right where I left it with my history and everything intact? I'd be amazed if it were.
s2disk works very very well, at least on my laptop. It's the right tool for this purpose.
Re:Interesting but how useful, really? (Score:5, Insightful)
Parent
Re: (Score:3, Insightful)
That makes sense, but there is using a PC and using a PC.
My main desktop machine I leave on 24x7. I might not be logged into it, but it is used to create off-site backups of some remote servers.
So while it isn't being used by me directly, it has a job to do during the nights it is left running.
Re: (Score:3, Insightful)
On or from a desktop?
If so, check out your BIOS to have the PC wake itself up in the middle of the night, just before your scheduled jobs kick off. Make the last scheduled job power the machine off and your problem is solved.
Re:Interesting but how useful, really? (Score:5, Insightful)
The thing is, even when you are indeed helping solve whatever problem you choose to participate in, in reality the design of those projects is to take advantage of the unused cycles of a PC while doing its "regular" scheduled work. That is, to maximize the usage of the PC.
By leaving your computer on only because of the @home projects you are doing the opposite, ie. not maximixing PC usage, because you are indeed "creating unused cycles" for idle time work. I see it like trying to maximize the electricity use at home by running a garbage-burning generator (just for the sake of the example), and then "creating" garbage on purpose just to "take advantage" of it. That's not really what the original intent of the generator was and thus is not maximizing anything.
Of course in the end it's your choice, just maybe something you could think about from a different perspective.
Parent
Re:Interesting but how useful, really? (Score:4, Insightful)
Fast boot laptops would be a nice feature. On the server side look at Sun's SMF of Solaris 10. It boots many services in parallel. Not only does this decrease boot time but SMF knows the depencies of all services. This is useful when troubleshooting a failed service. I'd like to see this in Linux.
Parent
Re:Interesting but how useful, really? (Score:5, Informative)
Yes! We will call it... Upstart! Oh wait.
Parent
Re: (Score:3, Interesting)
Gentoo's init system is like this (and has been for quite a while). It doesn't do stuff in parallel by default, but I think there is an option to enable that.
I think I remember hearing something about Ubuntu and/or Debian also trying to create something like that, as well.
Re:Interesting but how useful, really? (Score:5, Informative)
Parent
Re:Interesting but how useful, really? (Score:5, Informative)
Parent
Re:Interesting but how useful, really? (Score:4, Insightful)
This response illustrates a phenomenon my friends in the business refer to as:
"More friendly advice from the helpful Linux community"
Other examples include:
"Did you read the documentation?" - Ah, usually offered in response to your post that the documentation didn't help...
"If you don't understand this, you shouldn't be doing this" - Yes, that exaplains why Linux is so often touted as a great way to learn stuff.
"Did you try reinstalling?" - When not offered in response to your question which includes describing repeated installations, it is offered as a rational first step, especially to kernel problems...
"You should be using {insert other distro name here}, {insert your ditro name here} sucks" - You can count on this response immediately after a distro update, though it is also offered when you use a distro that is not one of the top 2...
"Can you give us your {insert all manner of filenames here}?" - usually asked for in response to problems that cause panics, but also offered for problems that do, after much investigation, not have any logs. Like games.
Sorry, but I had to blurt out another "this is not helpful" response. The fact is, some Linux machines do actually get shutdown, and for valid reasons. And the question presupposes that shutdown is a given, since the question was about startup...
But I get where you're coming from. Many Linux users have no concept of the conditions and uses that other Linux users work within. None whatsoever.
I rarely post helpful advice to Linux questions, mostly cause I don't have answers, but when I do I try to actually be helpful. And I usually try to be polite to those who aren't. But I slip now and then...
It's not quite as bad as Windows advice, which varies from "reboot" to "reinstall" to "post your hijackthis logs". You have to cultivate excellent technical sites for good advice, and give back when you can.
Oh, wait. this is /. after all... nevermind.
Parent
Re:Interesting but how useful, really? (Score:4, Insightful)
dditionally I use my computer so frequently (yes I`m a true geek... if I get up in the middle of the night I`ll often check email/see whats happening on IRC.. and I tend to shell in from work frequently)
And wouldn't that be exactly the point in reducing boot times? I shut down at night, but would be shut down more often if I could have my PC up and available in under ten seconds.
And P.S. getting on to check your email in the middle of the night isn't the sign of a true geek. It is borderline obsessive :).
Parent
Link to powerpoint presentation (Score:4, Informative)
Here's a poweropint presentation about this work [fenrus.org]. If you're an LWN subscriber you can you read an article and comments about the 5 second boot presentation [lwn.net] at the Linux Plumbers Conference (it will become viewable by all on from the 2nd October 2008). Finally you might be able to test drive some of this work if you are willing to sacrifice a USB key and destroy your existing EeePC install by because Moblin may include this work [moblin.org].
Parent
Re:Interesting but how useful, really? (Score:5, Insightful)
Unless your box is actually doing something useful overnight, you're wasting a lot of power leaving it switched on all the time. Never mind the tree-hugger angle, that's costing you money.
We've had various low power/sleep/hibernate modes available for _years_ now, I think we should work on getting those features working more reliably under Linux than telling users to change their ways to suit Linux's lack of progress. For that matter, just change the fucking boot process already, see every other modern OS for examples. Solaris, Mac OS X, Vista.. and I'm sure there are others who also moved on from crusty linear execution of shell scripts.
This is typical Linux-speak.. "It's not broke/missing, you should change."
Go ask someone with a Mac what his boot time is. "You mean you turn yours off?"
Try hibernating a Mac laptop. Don't know how? Close lid. Wait less than 5 seconds for blinky light. Unplug power and rip out battery. Yes, it hibernates that quick, and it's automatic.
iMacs, desktop systems mind you, default to standby mode after 10 minutes idle. It's even smart enough to not standby a system that's streaming music or sharing files, it'll just standby when the connections are closed. OS X's suspend/resume is the most reliable out there. True, it's because of the tight integration with Apple hardware, that's what you pay for. Linux and Microsoft are at a slight disadvantage, but that's the open PC market for you, love it or hate it.
Apple has paid particular attention to this area, but you might even learn a thing or two by looking at Vista's power saving modes. Also, Solaris has a nice streamlined boot process and replaced much of their old init stuff, you might want to check that out.
The Linux community can't just tell it's users to change any more, there are many alternatives, and I wouldn't say anyone is asleep at the wheel anymore. It's not just Linux vs. big sleeping giant Microsoft anymore like many of you thought around 2000. There's much more out there than Windows, and even that improves leaps and bounds every generation. Linux has hurt many traditional UNIX systems, and I can think of a big one that isn't going to (and doesn't have to) cave in to Linux. Than there's Apple, which frankly, Linux can't hold a freaking candle to, but anyone who really wants Linux to succeed on the desktop needs to pay close attention to them.
However, people aren't logical. People tend to place more emphasis on time spent waiting for the system to boot than a lot of other bottlenecks. You can argue about the reasons for this, it's an interesting psychological debate, but the fact is that it's true. Boot speed has a big psychological effect on how fast people think a system is. So, it's a good idea to optimize it.
Logic, schmogic, are you going to let every other system outperform Linux (in the eyes of the users, or however you want to put it) because you think your users have an illogical desire for a faster booting system? Are you trying to cleverly say you're right, users are wrong, but you'll appease them anyway? Yah, that's a nice twist on "customers are always right." The customer is wrong, but I'll do it anyway because they're stupid. That's a winning attitude. This is why Linux has so much trouble.
Parent
her? (Score:5, Funny)
A female Linux user?!? You can compile and install Gentoo while waiting for that to happen. : p
Re:her? (Score:5, Funny)
A female Linux user?!? You can compile and install Gentoo while waiting for that to happen. : p
Hey! I thought I was a real woman (and people with your point of view were extinct by now)
--
laura.
Parent
howto? (Score:3, Interesting)
Laptops (Score:3, Insightful)
Well, it helps if it's installed on a laptop or on old hardware.
Also it goes to quicker recovery time in case of outages. Coming from the Solaris world before they had journaling UFS filesystem it could take hours to FSCK a large partition before the OS would come up. On a production system that is a big deal.
It's not Linux that's slow (Score:3, Interesting)
On my systems, it's the BIOS that takes a very large chunk of the overall boot time. As far as it goes, I think the Core2 machine takes about the same amount of time to start loading the OS as the old 486 used to.
Having an x86_64 architecture is nice, but why oh why are we still lumbered with that legacy piece of you-know-what? I think I want a Mac Mini now, just because of that...!
-- Steve
Nice Try! (Score:4, Funny)
Parent
Re:It's not Linux that's slow (Score:4, Interesting)
Too bad coreboot [coreboot.org] doesn't run on any of my motherboards. Imagine having a busybox terminal ready to go before the LCD monitor powers up.
Parent
POST (Score:5, Insightful)
My problem is not the linux distro coming up to a login prompt, but the server getting past all the cards prompts to get to the normal boot. What with scsi controller cards having their own bios, the system bios, and miscellaneous others, it can take longer to get past the post then to boot linux. The HP DL360 G5's we have can take almost 30 seconds just to starting booting the linux kernel.
why bother with booting? (Score:5, Insightful)
Why not just get hibernate to work well and do that?
There is a lot of CPU chewed in the booting process and you can only do so much to speed it up.
Re:OT Grammar Nazi comment (Score:4, Interesting)
The use of "they" as a singular pronoun [wikipedia.org] is by no means universally accepted.
Parent
Re:OT Grammar Nazi comment (Score:4, Insightful)
Using the pronoun 'her' instead of 'his' is as sexually discriminatory as using simply 'his' has been judged to be in the past.
My grammar is terrible, but I do know that 'his' was used as the neutral/unspecified gender pronoun as well as the masculine pronoun (but we tend to use their now, it's what I would use) and that it has nothing to do with negative sexual discrimination.
Those that think women are denigrated by the use of "his" (eg "If a soldier lays down his arms ...") should really wonder why they think so little of women that they might need the rules of grammar to be changed to promote them.
Parent
Re:Lame Dupeness. (Score:4, Interesting)
OK, er, you fail. Epically.
These are completely different types of work. What Arjan is doing is tailoring boot to a specific set of software running on a specific set of hardware, using an entirely legacy-free init system.
This is nothing at all like what Fred is doing, which is optimizing a legacy boot system for completely generic hardware and software - it has to run on any system, with any set of software available from the Mandriva repositories installed.
The two types of work are utterly and entirely different.
For the record, another of our engineers - Claudio Matsuoka - has been working on the *other* type of boot system for several months now. It began as a re-implementation of the 'fastinit' system found in the Xandros distribution on the Eee. This system is called 'finit', and you can find it at http://helllabs.org/finit/ [helllabs.org] . It is used in Mandriva Mini, our custom edition for netbook OEMs. It pre-dates Arjan's work substantially, or at least the public announcement of it.
Parent