|
|
Subscribe / Log in / New account

LinuxCon: A tale of two bootcharts

August 25, 2010

This article was contributed by James M. Leddy

Attendees at LinuxCon 2010 were lucky enough to have not just one, but two presentations devoted to boot speed. The first was "How We Made Ubuntu Faster", by Upstart creator Scott James Remnant; the other was "Improving Android Boot-Up Time", by Tim Bird of Sony. As expected, Scott's talk was centered around netbooks running Ubuntu, while Tim focused on different development boards running Android. Nevertheless, there were some commonalities between both projects.

Ubuntu

No discussion of boot up speed would be complete without mentioning the 5 second boot achieved by Arjan de Ven and Auke Kok of Intel's Open Source Technology Center. In fact, a number of things from Scott's session assumed a knowledge of that effort by Intel.

[Ubuntu bootchart]

Good metrics are pivotal for improving boot time, and to get good metrics one must standardize the variables. The hardest of these is the machine, because everyone has different computers that have various components that are slower or faster than others. The Ubuntu team realized they would have to buy a whole bunch of "standard" computers. They chose the Dell Inspiron mini 10 netbook, dubbed the "touchpad from hell" by Scott because it was hard to use without the pointer jumping around. The laptop as a whole has the key requirement of being available in SSD and rotational media configurations, and is cheap enough to keep the project under budget.

The next important piece is to have a goal in mind. They chose 10 seconds, by "doubling the numbers that Arjan came up with". The kernel and initramfs get a total of two seconds. The same is allocated for platform initialization such as init scrips. The X server gets another two seconds, and the desktop environment, Gnome, gets four. It turns out these numbers weren't accurate predictors in the long run, but for some cases such as kernel, they were able to beat their deadline.

In order to create an automated system to measure the changes over time, the team threw together a pretty elaborate configuration where the system would reinstall the latest nightly builds, and then profile the resulting boot automatically. They compiled all the results and put them on Scott's people page.

One of the big portions of the Moblin kernel improvement was the early use of asynchronous kernel threads. They improved boot time by initializing the SATA controller, to handle storage, at the same time as the USB host adapters. Canonical built upon on this work by moving populate_rootfs(), the function responsible for unpacking the initramfs, to yet another asynchronous thread.

Though Intel claimed a speed boost from statically compiling modules into the kernel, the Canonical team has to be able to support more than just Intel netbooks. To achieve this, they cleaned up some of the slower parts of the init script, such as a replacement of a 10 millisecond poll of the blkid binary with an event based call to libudev. In the end the team was able to surpass their 2 second target, even with the requirement to use an initramfs.

Scott took some time here to plug Upstart. Though the Intel ultimately settled on a hand tuned invocation of the old System V init daemon to improve boot, Scott insisted that an event based system is better than "thousands of lines of shell script". This is even more true today because pretty much every system on the market has more than one CPU.

The Gnome environment took a bit of time to boot as well. Ubuntu uses Compiz by default, and this took almost half of the time allocated for the desktop environment. The audience asked if Compiz could be eliminated, but there are too many features of Ubuntu that depend on its inclusion. Other large offenders were gnome-panel and Nautilus. Altogether these components contributed to a 10 second Gnome start up, more than double their 4 second allotment.

Their research revealed that storage is the ultimate bottleneck. "Hard drives suck, but SSDs suck too" was the specific wording. To improve the situation, Scott used a well known tool called readahead. Initially developed at Red Hat, readahead is a tool that will log the filename for every instance of open() and execve() for the first 60 seconds of boot. Then on the next boot, a readahead process is spawned early that pulls all files in the list into the page cache, ensuring it's just a simple memory access when they're read later on.

Intel improved Red Hat's readahead with super-readahead, or sreadahead. This does the same thing, but was modified to only preload the blocks that will be read in, instead of the entire file. Since it's assumed to be a MeeGo system running on SSDs, and all SSDs have negligible seek time, the order of blocks on disk is not taken into account. Using an SSD, the Ubuntu system can read all blocks necessary for boot in 3 seconds.

[Readahead graph]

However, Ubuntu has to run on rotating media as well, so yet another iteration called über-readahead was created by Scott. The daemon was modified so that it reads blocks in order when using a rotating hard drive. The graph of this optimization shows a few random metadata reads, followed by a smooth linear path across the platter. For the rotational media, all pages necessary can be read into page cache in fewer than 7 seconds. Scott said that things can go even faster if the inital reads could be sorted and done in order prior to performing readahead on the file contents. There were a few file system patches sent to LKML, but inclusion does not seem likely at this point.

Scott concluded the discussion by admitting they didn't achieve their goal. The inability to reduce the desktop environment portion to fewer than ten seconds precluded a sub-ten second overall boot. Note this is on a Dell netbook, so the numbers will likely be better for systems with beefier processors and I/O subsystems, which includes almost all desktops and traditional laptops. In the presentation abstract, it is stated that some machines boot Ubuntu in as few as 5 seconds. The good news is that the kernel now takes fewer than 2 seconds to initialize, even with the initramfs requirement. And Scott did a lot of useful work that can be used by the larger community. Only time will tell if the other distributions take advantage of his work.

Android

Tim ran into a unique set of problems with Android handsets. Whereas Scott's problems were already well known in the much wider desktop Linux community, Tim is working with a suite of tools with names like Dalvik and Zygote, whose source code has rarely been modified outside of Google. As such, Tim's focus was about getting an initial performance profile to find what part of the boot process will yield the largest reduction in time, and in turn should get the most developer effort.

[Android board]

He profiled three different platforms, the ADP1 and Nexus 1 from HTC, and an EVM OMAP3 board from Mistral Solutions. The overall time for these machines to boot was 57, 36, and 62 seconds, respectively. Though these are all ostensibly development machines, that number still seemed huge compared to the netbook boot times, but it should be mentioned that these boards have a much slower processor and storage. By the same token, you can do a lot more with a fully functional Gnome desktop than a smart phone. Tim pointed out that "it's really sad that you can use a stopwatch to accurately measure a phone booting up".

The boot chart for the EVM board revealed a number of areas for improvement. Android uses a rewritten Java-esque virtual machine called Dalvik in all of its phones. For optimal user experience, all of the classes must be preloaded before the phone is used. Zygote, the utility responsible for doing this work, spends about 21 seconds in I/O wait. The application classes don't have to be preloaded, one can choose to load them on demand, but this is just pushing the problem back and causes longer application load times. Worse, there is a memory penalty for each class now has to be loaded in a different heap, so the memory for identical classes can't be shared.

[Android bootchart]

A potential solution is to figure out how to load every class into Zygote's heap, so that you can have something akin to shared libraries in a conventional OS. Another possible solution is to make Zygote threaded, and have one thread use the CPU while the other is reading from storage. A more far out possibility avoids reading in the classes at all and loads the heap as a binary blob, though this would take the most development effort and would require a rebuild when new classes are installed.

The other potential speed gain lies in the package scanning tool. The purpose of this tool wasn't exactly obvious to Tim, but he illustrated its complexity by showing the call tree. At the end of it all is the parseZipArchive() function, which is called 138 times. There is some low hanging fruit there, for example Tim shaved off a few seconds by commenting out a sanity check of the zip file headers. Just above that is a ZipFileRO::open() call which will mmap() the zip file into memory. The problem is that parseZipArchive() walks the mmaped region and builds a hash table to make subsequent accesses easier, causing page faults for the entire archive. All this is done just to extract one file, AndroidManifest.xml, so the time and memory spent to fault in all those pages and build the hash table is essentially wasted.

There is an emerging consensus within the Android development community that a lot of time can be shaved if readahead is used. But Tim thought it was masking the underlying problem, and that some of the blocks shouldn't be read at all, much less used to populate the page cache. Scott, who was in the audience at this discussion, noted that readahead isn't really about masking temporal locality of reference or "papering over problems", but it is about using the CPU while populating the page cache. Tim still felt that using readahead would make the problems with the code less noticeable, and developers wouldn't be as motivated to fix them. They both agreed when this ships on a device to consumers, it should have readahead enabled.

Unfortunately there were no significant speed ups in boot time yet, but there is still work to do. Interested readers are encouraged to sign up for the Android mailing lists, and check out the eLinux wiki.

Conclusions

Though Android and Dalvik are a departure from the traditional GNU userspace that Ubuntu uses, they do have some commonalities. Firstly, because the kernel is not impacted by user-space differences, kernel improvements will be available for any and all Linux devices. Tim didn't mention the kernel because there are already a lot of well known techniques to boot the kernel faster, so it was outside of the scope of his talk. Presumably, the techniques covered in the Ubuntu presentation would also help the Android system boot more quickly.

Some improvements in user space carry over as well. Readahead is a generic enough technique that it can be included in pretty much any environment. Similarly, profiling techniques like bootchart and ftrace can be run in both environments. However, generic GNU userspace has the advantage of more code sharing and reuse than third party environments like Android. Improvements to booting the X server, for example, will be felt across Ubuntu, MeeGo, and the other desktop Linuxes out there. That isn't the case for Android.

Even so, the developer community for Android is growing and Tim is evidence of that. The problem of slow Android boots has probably not been thought about much outside of Google's office walls, but that is changing. The potential for improvement is there, especially in Android-specific places like the package scanner and Zygote. For desktop distributions and even specialized distributions like MeeGo, the fast boot story may be largely coming to an end. For Android, it's only just beginning.

[ Bootcharts, graph, and photo courtesy of Scott James Remnant of Canonical and Tim Bird of Sony. ]

Index entries for this article
GuestArticlesLeddy, James M.
ConferenceLinuxCon North America/2010


to post comments

LinuxCon: A tale of two bootcharts

Posted Aug 26, 2010 4:20 UTC (Thu) by neilbrown (subscriber, #359) [Link] (7 responses)

> A more far out possibility avoids reading in the classes at all and loads
> the heap as a binary blob, though this would take the most development
> effort and would require a rebuild when new classes are installed.

Brings back memory of building EMACS back in the '80s. In the last stage it would fire up the newly compiled emacs, load all the elisp files, then dump core. A support tool would combine the core file with the original binary to create a new binary which had the compiled elisp already loaded in the data section.

LaTeX did that too I think.

Everything old is new again!

LinuxCon: A tale of two bootcharts

Posted Aug 26, 2010 4:58 UTC (Thu) by rsidd (subscriber, #2582) [Link] (1 responses)

"Hibernate" seems to be the ultimate core-dump: dump all of memory to the disk, and reload it on power-up. However, I haven't yet used a linux machine where resuming from hibernate was faster than a fresh boot. (Even on Windows, there isn't much difference). The main advantage is that it preserves the state of the system: if I factored in the time to open all the programs I have, reload all documents, webpages, etc, hibernate would be a big win.

Luckily, on my current laptop, "sleep" (suspend-to-ram) works very well, so I rarely do anything else.

LinuxCon: A tale of two bootcharts

Posted Aug 26, 2010 14:30 UTC (Thu) by Fowl (subscriber, #65667) [Link]

<OT>
I've always found hibernate on Windows to be significantly faster than a fresh boot. Perhaps I'm stuck with hardware that is too low end though - 1GB of IO is faster than 4GB of IO shock horror!

Sleep (and "Hybrid Sleep", aka suspend to ram + hibernate) _are_ marvellous, barring any firmware SNAFU's.
</OT>
re: old is new
A good idea is a good idea. ;)

LinuxCon: A tale of two bootcharts

Posted Aug 26, 2010 5:39 UTC (Thu) by thedevil (guest, #32913) [Link] (2 responses)

Back in the 80s? It still does precisely that AFAIK. Other programs which provide both scriptability and a built-in core written in the scripting language do something similar, or else they just ship the core blob in the source (hello ocaml!)

LinuxCon: A tale of two bootcharts

Posted Aug 26, 2010 9:52 UTC (Thu) by liljencrantz (guest, #28458) [Link]

The difference is that back in the 80s, a lot fewer people used prepackaged emacs.

LinuxCon: A tale of two bootcharts

Posted Aug 26, 2010 18:01 UTC (Thu) by iabervon (subscriber, #722) [Link]

I thought emacs switched at some point from actually dumping core to more explicitly byte-code compiling the elisp and writing it to files, on account of needing a substantial chunk of optional elisp from a very large library when starting up; dumping only the fundamental stuff was still too slow, and dumping everything would require reloading too much, so they needed a quick way to load individual modules, and this obsoleted the core dump mechanism. But I could be wrong; it's been ages since I've actually watched emacs build.

LinuxCon: A tale of two bootcharts

Posted Aug 26, 2010 22:47 UTC (Thu) by nix (subscriber, #2304) [Link] (1 responses)

Emacs did that for a long time, then both Emacs and XEmacs shifted to a more explicit serialization mechanism (the resulting files are mmap()ed in, so still shared between instances IIRC), mostly because keeping unexec() working was a pain.

LaTeX never did the coredump trick because it wasn't originally written on a Unix system at all (hell, it's written in Pascal). It's always written out a serialized representation of its state ('format files') then loaded them later. I'm not sure how valuable this is for LaTeX proper anymore (who cares about a fraction of a second?) but it's very valuable for big formats like ConTeXt, which takes ages to load even on modern systems.

LinuxCon: A tale of two bootcharts

Posted Sep 2, 2010 11:20 UTC (Thu) by jschrod (subscriber, #1646) [Link]

For LaTeX it is still of interest in special circumstances where one preloads classes and packages as well and then dumps the fmt file.

In a current project of mine, I was able to improve the format time of a document from 4 sec to 0.4 secs with usage of such a format file. It's not much for one document, but since (a) we're producing ca. 15 million documents a year and (b) this is also used in an interactive environment, such performance improvements were very well received by our users.

sreadahead

Posted Aug 26, 2010 5:04 UTC (Thu) by arjan (subscriber, #36785) [Link] (7 responses)

the text is slightly inaccurate; sreadahead also works great on disks and sorts the ios it does in disk order. in fact, when used on btrfs, it will even order the disk blocks using the btrfs ioctls to make the files be consecutive on disk (on average)

sreadahead

Posted Aug 26, 2010 9:53 UTC (Thu) by liljencrantz (guest, #28458) [Link]

So what, then is the difference between sreadahead and über-readahead?

sreadahead

Posted Aug 26, 2010 13:07 UTC (Thu) by blitzkrieg3 (guest, #57873) [Link]

Apologies. I based that on what Scott said at the discussion as well as this forum post. Can those ioctls be written for ext4? In the LPC article it was mentioned that Ted Tso suggested this for ext4, but I don't know if it has been done since.

sreadahead

Posted Aug 30, 2010 16:01 UTC (Mon) by giraffedata (guest, #1954) [Link] (4 responses)

On a solid-state block device, where order doesn't matter, what is the point of sreadahead? The only advantage I know to reading stuff into cache ahead of time is that you can do it in optimal order.

With disk drives, I don't think user space should be ordering the reads -- that expertise belongs in the block layer and below. All you have to do is pile all the read requests into the block layer and it will order them properly (of course, you don't have to get everything in the queue at once -- eliminating 99% of the seek time is fine).

And though I don't know what the state of implementation is, in theory you shouldn't be piling anything explicitly into the block layer either; you should just be advising the block layer of your plans to read that stuff later (madvise).

sreadahead

Posted Aug 30, 2010 20:07 UTC (Mon) by Jonno (subscriber, #49613) [Link] (3 responses)

The only advantage I know to reading stuff into cache ahead of time is that you can do it in optimal order.

The main advantage is to never have to do iowait but always have the data you need at hand. Eg doing 10 seconds of disk reads and 15 seconds of CPU time in 15 seconds rather than in 25 seconds.

sreadahead

Posted Aug 30, 2010 21:59 UTC (Mon) by giraffedata (guest, #1954) [Link] (2 responses)

The main advantage is to never have to do iowait but always have the data you need at hand. Eg doing 10 seconds of disk reads and 15 seconds of CPU time in 15 seconds rather than in 25 seconds.

OK, I forgot about that. So I take it sreadahead runs in parallel with other boot processes?

But just based on what I've seen and heard my disk drive do during painfully slow boots, I'll bet the CPU time is dwarfed by the seek time, so overlapping CPU and disk time wouldn't buy a whole lot.

sreadahead

Posted Sep 2, 2010 3:18 UTC (Thu) by blitzkrieg3 (guest, #57873) [Link] (1 responses)

> But just based on what I've seen and heard my disk drive do during painfully slow boots, I'll bet the CPU time is dwarfed by the seek time, so overlapping CPU and disk time wouldn't buy a whole lot.

That's the whole point. The HD is doing a lot of seeking when it could just be moving the head down the platter across all of the tracks linearly, which means zero seek time.

Also look at the charts, even if you discount the HD seeking, it buys about 7 seconds. Otherwise these seconds would be spread about the boot while a process was blocking instead of actually running.

sreadahead

Posted Sep 2, 2010 6:09 UTC (Thu) by giraffedata (guest, #1954) [Link]

That's the whole point. The HD is doing a lot of seeking when it could just be moving the head down the platter across all of the tracks linearly, which means zero seek time.

That's the whole point of what? It wasn't the point of the article or any previous comment, since they talked about SSDs (no seek time) and about CPU overlapping disk time. (Simply overlapping CPU and disk time, on mechanical disk systems I know would be barely noticeable, because the disk time is so great compared to the CPU time).

On the SSD-based system, though, the overlap is significant because the disk time is so much shorter. If overlapping buys you 7 seconds toward a 10 second boot, the CPU time and disk time must be of the same order.

Touchpad from Dell hell (OT)

Posted Aug 26, 2010 19:15 UTC (Thu) by boog (subscriber, #30882) [Link] (1 responses)

'They chose the Dell Inspiron mini 10 netbook, dubbed the "touchpad from hell" by Scott because it was hard to use without the pointer jumping around.'

Interesting. Although I don't have that precise Dell notepad, I think my Latitude D430 has a touchpad from the same place. The pointer will jump suddenly (possibly under load). Though some progress has been made in that it will often return now after its jump, it still causes plenty of problems and is *very* ugly.

Do any of the assembled geniuses happen to know where the problem resides and if it is fixable? I hardly know where to start - kernel, X, ...

Best regards

Touchpad from Dell hell (OT)

Posted Aug 26, 2010 22:15 UTC (Thu) by sflintham (guest, #47422) [Link]

There is some information in this bug report. I think I installed some package from a PPA with Ubuntu 9.10 to largely fix the issue. I must admit I haven't used my Mini 10 much since I upgraded to 10.04, but it appears to be fixed by default there. (FWIW, I do recall the Dell-supplied Ubuntu 8.04 (?) didn't have any problems either.)

Grammmar error

Posted Aug 26, 2010 20:25 UTC (Thu) by tmassey (guest, #52228) [Link] (1 responses)

"can be run both environments" is incorrect. I can't come up with a simple word to insert there and correct (and complete) the thought. I guess it would have to be something like "can be used to improve both environments"?

Grammmar error

Posted Aug 26, 2010 20:28 UTC (Thu) by jake (editor, #205) [Link]

> "can be run both environments" is incorrect.

yup, it is ... seemed like 'in' fit in well there, so that's what i did.

thanks for the report, just a friendly reminder that typos should go to 'lwn@lwn.net'.

jake

LinuxCon: A tale of two bootcharts

Posted Aug 26, 2010 20:30 UTC (Thu) by Trelane (subscriber, #56877) [Link]

"have to buy a whole bunch of "standard" computers."

This would be the nonstandard standard?

LinuxCon: A tale of two bootcharts

Posted Aug 26, 2010 20:36 UTC (Thu) by Trelane (subscriber, #56877) [Link] (7 responses)

"Though Intel claimed a speed boost from statically compiling modules into the kernel, the Canonical team has to be able to support more than just Intel netbooks."

What specifically is the slow part of modules? Having to suck them in individually?

It seems like it ought to be possible to build some sort of metamodule to avoid one-by-one; put them all in one glob and suck them in en masse.

If that's not it, it seems like it ought to be possible to create a hybrid kernel with quasi-modules for the hardware you installed on already in and ready to go.

LinuxCon: A tale of two bootcharts

Posted Aug 26, 2010 22:26 UTC (Thu) by Jonno (subscriber, #49613) [Link] (4 responses)

What specifically is the slow part of modules? Having to suck them in individually?

Actually, modules loaded after rootfs is mounted isn't the problem. The problem is the initramfs, ormore acurately vmlinuz+initramfs . So simply building all modules normaly included in the initramfs into the kernel won't help either (well, you do loose the early userspace bits, which helps somewhat, but are neglible in the big picture). What you need is fewer modules to load prior to rootfs is mounted, and that can only be done by knowing the hardware in advance.

The problem is that vmlinuz and initramfs must be loaded prior to accessing the driver for your sata/pata/scsi/etc controller. There are special bios calls that let you do this, but those are crappy. Each call only fetches a single block (512 bytes) and requires a pass through the kernel/bios boundary as well as a call to the harddrive.

A kernel/bios boundary is essentially the same as a userspace/kernel boundrary, but bioses are generally crappy, and will usually trash all register, most or all L1 cache, and up to 1MB of the L3 cache. Doing that thirty-five-thousands-and-thirty-seven (35,037) times (my Ubuntu netbook) can take a few seconds...

LinuxCon: A tale of two bootcharts

Posted Aug 27, 2010 14:57 UTC (Fri) by BenHutchings (subscriber, #37955) [Link] (3 responses)

"The problem is that vmlinuz and initramfs must be loaded prior to accessing the driver for your sata/pata/scsi/etc controller. There are special bios calls that let you do this, but those are crappy. Each call only fetches a single block (512 bytes) and requires a pass through the kernel/bios boundary as well as a call to the harddrive."

No, it's not that bad; you can read multiple sectors at a time. And the kernel is not involved at this point. There's just a boot loader which is probably running in real mode, at least while it's looping over the block list.

The annoying thing about driver modules is that module initialisation, which includes binding to and probing all the devices they can handle, is serialised. Initialisation of built-in drivers can be parallelised. I assume this is hard to change, otherwise someone would have done it already.

LinuxCon: A tale of two bootcharts

Posted Aug 27, 2010 18:00 UTC (Fri) by Trelane (subscriber, #56877) [Link] (2 responses)

I am painfully aware that I'm hitting the envelope of my knowledge, pretty hard.

"The annoying thing about driver modules is that module initialisation, which includes binding to and probing all the devices they can handle, is serialised."

It strikes me, however, that the basic problem *here* is finding out what hardware is present and not present. In the vast majority of cases, I'd wager that this really only needs done once (rather like the crypto hardware tests): upon installation. Beyond that, what's needed is graceful fallback for the rarer cases the hardware isn't present anymore, and what we already have: new hardware detection.

This could be mitigated by means of a table of "known to be present" hardware information supplied to a bulk-loaded module set (something along the lines of putting all the .ko's into a single .ko with tables specifying that it's a bulk module and where everybody's at in it, as outlined above.) If intialization of the known hardware fails, then it could perhaps fall back to probing.

LinuxCon: A tale of two bootcharts

Posted Aug 27, 2010 20:13 UTC (Fri) by BenHutchings (subscriber, #37955) [Link] (1 responses)

It strikes me, however, that the basic problem *here* is finding out what hardware is present and not present.

I think you're confused about how hardware probing is done. Back in the 90s PCs would have a load of ISA devices that each had to be probed in their own way. Today almost every device is described by ACPI tables or the standard PCI or USB configuration mechanisms. The kernel uses these to find which devices are present and only invokes the drivers associated with them. It also sends events out to udev, which loads modules if needed. The 'probing' I refer to involves drivers checking which variant is present and then initialising it appropriately; drivers that you don't need will never be invoked. (There are exceptions, e.g. 8139cp and 8139too handle different devices with overlapping sets of device IDs. Normally they will both be loaded and may both probe the same device.)

This could be mitigated by means of a table of "known to be present" hardware information supplied to a bulk-loaded module set (something along the lines of putting all the .ko's into a single .ko with tables specifying that it's a bulk module and where everybody's at in it, as outlined above.)

That might be worth a try.

LinuxCon: A tale of two bootcharts

Posted Aug 27, 2010 20:21 UTC (Fri) by Trelane (subscriber, #56877) [Link]

I think you're confused about how hardware probing is done.
Oh, that's a virtual certainty. ;)
[excellent lesson here; thanks!]
The 'probing' I refer to involves drivers checking which variant is present and then initialising it appropriately; drivers that you don't need will never be invoked.
Is this part done via ACPI, as outlined above? Or is this done 90's style? What's the slow part of this, precisely? Is it the initialization? If so, why is it significantly faster to have the module in-kernel?
That might be worth a try.
wish I had time to. It sounds like perhaps a rather extensive project, as it touches on fundamentals of how things work. If static linking is truly a significant portion of the boot process, though, it might well be worth it. Only testing would tell.

LinuxCon: A tale of two bootcharts

Posted Aug 27, 2010 17:45 UTC (Fri) by dlang (guest, #313) [Link] (1 responses)

the slowest part is deciding if the module should be loaded or not, and if you load a module that isn't needed, waiting for the module to decide that the hardware it's trying to initialize really isn't there.

a monolithic kernel that is tailored for your hardware (includes all the drivers you need and few or none that you don't) will boot up _much_ faster as a result.

LinuxCon: A tale of two bootcharts

Posted Aug 27, 2010 18:04 UTC (Fri) by Trelane (subscriber, #56877) [Link]

deciding if the module should be loaded or not, and if you load a module that isn't needed, waiting for the module to decide that the hardware it's trying to initialize really isn't there.
I think the remedy for this could be implemented as I replied back to the other subthread. I don't know, however, if this is at all feasible, but the core problem is that upon first boot the kernel doesn't know what hardware is present and what isn't. Supplying information pertaining to what is likely to be found again (a simple list with information on what modules were most recently used would be a simpler algorithm, and since it could clearly rely on userspace tools to put together the information, this could be a policy thing) would avoid this. The problem would then be making sure we fall back gracefully (simple idea would be to just fall back to scanning as is currently done).

LinuxCon: A tale of two bootcharts

Posted Aug 26, 2010 21:58 UTC (Thu) by PhracturedBlue (subscriber, #4193) [Link] (2 responses)

I must be missing something. The Intel guys were loading Gnome, and got to 5 seconds, right?

I assume they didn't use compiz (and while I use the Ubuntu netbook edition on mine, I dunno that I really need it either), but even that seems to be only 4 seconds additional. So what did the Intel guys do to gnome to make gnome so much faster than the Ubuntu folks can manage?

I'd love my netbook to boot in 5 seconds, but after trying MeeGo, I'm not willing to move to it to achieve that goal.

I like the interface Ubuntu provides on my netbook, but I'd be willing to try a different environment if it brought a significant speedup.

LinuxCon: A tale of two bootcharts

Posted Aug 27, 2010 0:35 UTC (Fri) by Jonno (subscriber, #49613) [Link] (1 responses)

I must be missing something. The Intel guys were loading Gnome, and got to 5 seconds, right?

No, they used a slimmed down XFCE on a feature stripped X...

LinuxCon: A tale of two bootcharts

Posted Aug 28, 2010 17:36 UTC (Sat) by i3839 (guest, #31386) [Link]

Or in other words: Pigs don't fly. ;-)

LinuxCon: A tale of two bootcharts

Posted Aug 30, 2010 22:12 UTC (Mon) by jcm (subscriber, #18262) [Link] (9 responses)

Why does it matter how long it takes for a cellphone to boot?

I say that to be intentionally provocative, but let's be honest, I reboot my Android phone maybe once every few weeks, and the less-than-a-minute it takes to boot isn't a huge deal over that kind of timeframe. Yea, it's annoying for developers of Android core bits, but it's not the end of the world. We probably need to be a bit more honest about why we like low boot times, given that it is likely more for pretty graphs than because the user really boots their phone enough times to find it a selling feature.

Jon.

LinuxCon: A tale of two bootcharts

Posted Aug 30, 2010 22:13 UTC (Mon) by jcm (subscriber, #18262) [Link]

Same goes for laptops that don't dual-boot. If you're only rebooting your laptop or netbook every few days/weeks, it's going to be tough to convince me that it really really matters.

LinuxCon: A tale of two bootcharts

Posted Aug 30, 2010 22:25 UTC (Mon) by dlang (guest, #313) [Link] (1 responses)

I find it annoying, but then again it may be usual for people to use their phones continuously enough to drain the battery to the point where they shut off, then scramble for power and have to sit and wait for the phone to turn back on.

if the phone booted more rapidly, I'd turn it off during movies instead of just turning it to vibrate.

if you can boot fast, then you can power off and reboot instead of doing a suspend (with all the overhead of saving your entire memory to durable media)

LinuxCon: A tale of two bootcharts

Posted Sep 7, 2010 15:34 UTC (Tue) by Aissen (subscriber, #59976) [Link]

if the phone booted more rapidly, I'd turn it off during movies instead of just turning it to vibrate.

That's what "Airplane Mode" is for :-)

LinuxCon: A tale of two bootcharts

Posted Aug 30, 2010 22:31 UTC (Mon) by foom (subscriber, #14868) [Link] (5 responses)

> Why does it matter how long it takes for a cellphone to boot?

Probably not a huge deal.

But I really wish my Garmin GPS unit would boot up quicker. It's kind of annoying that by the time it's started up and gotten a satellite lock, I can be halfway to my destination. :)

LinuxCon: A tale of two bootcharts

Posted Aug 30, 2010 22:57 UTC (Mon) by dlang (guest, #313) [Link] (3 responses)

one situation where phone boot time could be critical.

My grandmother (92) carries a cell phone for emergancy use only, it's turned off unless she needs to make a call.

In an emergancy, I could very easily see a 1-minute boot time being critical.

now the phone she uses isn't a smartphone, but the point is that just because you leave your phone on all the time to receive incoming calls, doesn't mean that everyone will, and for those that don't, the boot time is significant.

on my laptop I don't care much about boot time, but that's because I so seldom turn it off, it goes from external power at home to external power in my turck to external power at the destination...

I don't use suspend, but I don't boot it more than once every couple of months.

LinuxCon: A tale of two bootcharts

Posted Aug 31, 2010 4:20 UTC (Tue) by jcm (subscriber, #18262) [Link] (2 responses)

I think you answered the critical-use only situation quite well - don't get a smartphone (computer). It's not that boot time doesn't matter to anyone, but I made my comment in that way to exaggerate the absurdity of caring about boot time before everything else is fixed. There are so many other actual issues out there that matter more before that does.

LinuxCon: A tale of two bootcharts

Posted Aug 31, 2010 4:26 UTC (Tue) by dlang (guest, #313) [Link]

I have mixed feelings on priorities, to a large extent speeding up boot time involves finding a way to not need to do things at boot, and that ends up paying dividends overall, not just at boot time.

Linux on Grandma's phone

Posted Aug 31, 2010 17:04 UTC (Tue) by dmarti (subscriber, #11625) [Link]

If the cell carriers can eke out enough additional revenue per low-end subscriber using "crapware", then the Android phone becomes the free-with-service phone, and the fast-booting phone vanishes from the market. So it's reasonable to start making Android usable for Grandma's emergency glove compartment phone now.

LinuxCon: A tale of two bootcharts

Posted Sep 3, 2010 21:13 UTC (Fri) by roelofs (guest, #2599) [Link]

But I really wish my Garmin GPS unit would boot up quicker. It's kind of annoying that by the time it's started up and gotten a satellite lock, I can be halfway to my destination. :)

Ditto, but at least it has an excuse: the world has changed every time it boots. (AFAIK, the long lock time is due to it trying different antenna configurations in order to optimize overall signal strength from the current spread of satellites. Changing its orientation while it's doing that can seriously slow it down, btw...)

Greg

LinuxCon: A tale of two bootcharts

Posted Sep 3, 2010 20:19 UTC (Fri) by oak (guest, #2786) [Link]

The Android fsck_msdos execution was interesting, was it for an empty FAT file system or a full one? If latter, how many files & dirs it had? (thousands, tens of thousands?)


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