Stories
Slash Boxes
Comments

News for nerds, stuff that matters

Slashdot Log In

Log In

Create Account  |  Retrieve Password

How Kernel Hackers Boosted the Speed of Desktop Linux

Posted by timothy on Thu Oct 02, 2008 04:17 PM
from the mild-claims dept.
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."
+ -
story

Related Stories

[+] Reducing Boot Time On a General Linux Distro 354 comments
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."
[+] 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
More
Loading... please wait.
  • Not only is this an impressive accomplishment, but if this can be applied generically to most distributions then it should present an excellent opportunity for advertisement. Showing how you can boot, check your email, read the latest news, and be done with all you need to have done while a fellow Vista machine is still booting says a lot. Even if we can get most distributions down to 15sec average, it's a huge leap. Grats to these guys.
    • by Anonymous Coward on Thursday October 02 2008, @04:29PM (#25238083)

      Kudos to you sir, for reducing the time it takes to type congratulations by instead using grats!

    • Actually Vista with 4 Gigs of RAM boots pretty quickly. It's once it's up that it is slow.
    • by SilentChris (452960) on Thursday October 02 2008, @04:43PM (#25238289) Homepage

      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.

      • by sofar (317980) on Thursday October 02 2008, @05:05PM (#25238603) Homepage

        actually we do bring up the network daemon (either connmand or network manager) as soon as we can, but we don't stop the entire startup process.

        on my test system here it runs dhclient about when X starts up and the network card receives a reply with a few seconds from that, long before I can start firefox :)

      • by schwaang (667808) on Thursday October 02 2008, @05:09PM (#25238659)

        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.

    • by not already in use (972294) on Thursday October 02 2008, @04:46PM (#25238359)

      but if this can be applied generically to most distributions then it should present an excellent opportunity for advertisement.

      Not going to happen. If you read the article, you'll see that they compiled all drivers directly into the kernel, so it is essentially an embedded device now. Also consider the fact that they are using a SSD, which is going to decrease boot times regardless of any boot-process improvements.

      So basically, you could never apply these speed increases to a generic distro.

      • by nschubach (922175) on Thursday October 02 2008, @04:54PM (#25238451) Journal

        ... but an OEM can. (If they were so inclined.)

      • by sofar (317980) on Thursday October 02 2008, @04:58PM (#25238497) Homepage

        says who?

        We talked with both the fedora and ubuntu developers at the LPC and even they agreed that a LOT more drivers should be compiled into the kernel instead of being modules (c'mon, ext3 as a module? really?).

        99% of what we did to make this work in 5 seconds applies straight for generic laptops and even most people's desktop sytems.

        The speedups _still_ are relevant with generic spinning media too. Maybe those are not as fast as SSD's, but the principle is still the same (IOW, for instance reading data in the order that you need it, is better than reading it in the order that it is scattered across the hard disk)

        speeding up the kernel to boot in 1 second is TOTALLY applicable to generic distros (not only that, it's relatively easy and we basically already did that).

        speeding up X startup to be 1.5s is TOTALLY applicable to generic distros.

      • by MMC Monster (602931) on Thursday October 02 2008, @05:02PM (#25238569)

        Why not?

        How about the first time the system boots, it profiles what drivers are installed. It then recompiles the kernel to include those drivers.

        On subsequent reboots, it uses the recompiled kernel and then, once the system is up and running, check to see if something that is compiled in is no longer needed, and see if something has been added that should be compiled in.

        I'm sure it's not *that* easy, but maybe an idea for the future?

      • by ColaMan (37550) on Thursday October 02 2008, @05:07PM (#25238639) Homepage Journal

        So basically, you could never apply these speed increases to a generic distro.

        Oh come now! Never say never!
        You could:

        - Boot with modular kernel.
        - Probe devices and get a list of loaded modules.
        - Recompile kernel with said modules built-in.
        - Boot with that kernel from now on.

        It's relatively scriptable - in fact, I think there's a "probe loaded modules and generate new .config" script already about the place. If the user is unwilling to wait for a kernel recompile during install, just stick with the modular kernel and incrementally compile during idle time.

        It's trivial. I'd code it up myself, but I'm a little busy at the moment, you understand.

  • TFA (Score:5, Interesting)

    by mcgrew (92797) * on Thursday October 02 2008, @04:31PM (#25238115) Journal

    And no cheating. "Done booting means CPU and disk idle," Arjan said. No fair putting up the desktop while still starting services behind the scenes. (An audience member pointed out that Microsoft does this.) The "done booting" time did not include bringing up the network, but did include starting NetworkManager.

    It seems to me that the five seconds could concievably be brought down to virtually zero with cheating! My work PC slows down so much sometimes from antivirus, inventory controls, etc that it takes longer than that to add a record or open a table in an Access database. With a keyboard buffer you could stick a fake desktop and login in, and have the real desktop and login take over before the user finished typing in his password.

    • Re:TFA (Score:5, Interesting)

      by Shikaku (1129753) on Thursday October 02 2008, @04:45PM (#25238327)

      Yes, please. More common users would benefit from this greatly. I would love a prompt for user and password while it is booting, because most users do not leave their computer all day, especially laptop and handheld/UMPC users.

      With desktop computers, I really think that the time it takes to boot into Ubuntu, THEN going into a Gnome prompt, THEN loading the services and desktop is a silly idea.

  • by mikael (484) on Thursday October 02 2008, @04:32PM (#25238129)

    My stepfather still has an old Pentium III laptop with Windows 95 running on it. Booting the laptop to read an E-mail takes around 20 minutes. His advice to anyone who wants to use it, "switch on the PC, do something else like have a bath, do the lawn, read the newspaper, or have a coffee, and the PC will be ready to use before you know it".

  • by Sits (117492) on Thursday October 02 2008, @04:38PM (#25238219) Homepage Journal

    This is effectively related to an earlier Slashdot story about the changes Mandriva are making to speed up boot on their distro [slashdot.org]

    In an attempt to head off the inevitable here's a link straight to the existing
    Interesting but how useful, really? thread (Yes! No! I have a Mac! I use suspend! I use hibernate! Suspend is broken for me! Hibernate is broken for me! Hibernate takes too long with 500Mbytes! Why do Linux people always say change your habits? Etc.)

    What I really want to know is what can be done about usb-storage and pciehp (PCI Express hotplug). I have an EeePC 900 using a kernel with Arjan's fastboot patches [lkml.org] and with USB entirely disabled and pciehp turned off the kernel mounts the root filesystem in just over one second. With USB on and pciehp in use it's over 5 seconds....

    Finally here's a link to Arjan's slides from the presentation about 5 second boot in PowerPoint format [fenrus.org] and a YouTube video of the 5 second boot on an EeePC 901 [youtube.com].

    • by sofar (317980) on Thursday October 02 2008, @04:49PM (#25238379) Homepage

      We've sent a patch to Greg KH making USB initialization go in parallel which reduces usb initialization from [N * 0.1] seconds (where N is the number of usb ports in your system to [0.1]. This patch is currently in linux-next afaik.

      I'm wondering why you would even have PCIe HP turned on on an asus 900 :)

  • by russotto (537200) on Thursday October 02 2008, @04:39PM (#25238229) Journal

    I'd love for my MythTV box to boot faster. Since it's not silent (though the TV fans are louder, the TV isn't always on either), I leave it turned off, and the long boot time makes it less appliance-like.

  • by techno-vampire (666512) on Thursday October 02 2008, @05:03PM (#25238575) Homepage
    Note that nowhere in the article is there any mention of the processor, its speed or the number of cores. There's also not one word about how much RAM the machine has. With enough RAM, you can load your entire system into a RAMdisk and even if you don't have SSM access time becomes (effectively) zero. Also, of course, a 2Ghz quad core machine is going to boot faster than a 1 Ghz single core. I'm not saying they're cheating or anything, but these specs are something you need in order to evaluate what they've done, and they're not telling us.
    • Re:Yeah but... (Score:5, Interesting)

      by AKAImBatman (238306) * <akaimbatman@ g m a i l . com> on Thursday October 02 2008, @04:28PM (#25238077) Homepage Journal

      ROM was a wonderful thing. Simply flip the switch and the software is already loaded into memory. There was about a second or two of initialization (on a ~1MHz 8-bit processor!) and you were ready to go. 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.

      Unfortunately, desktop OSes are so complex that using re-flashable ROM adds a great deal of complexity and cost to the design. Thus you aren't likely to see any systems keep their OS in Flash. Compounding the problem is that modern OSes are rarely designed to boot from a ROM configuration and would require substantial changes to boot properly.

    • Re:Does it matter? (Score:5, Insightful)

      by arth1 (260657) on Thursday October 02 2008, @04:36PM (#25238189) Homepage Journal

      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:Does it matter? (Score:5, Insightful)

        by tepples (727027) <slash2006NO@SPAMpineight.com> on Thursday October 02 2008, @04:54PM (#25238455) Homepage Journal

        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.

        • by not already in use (972294) on Thursday October 02 2008, @04:49PM (#25238381)
          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.