Let's boot with Upstart (GDM ready in 15s)
I got bored and rewrite my entire system to boot up with Upstart. Yes, I rewrote all jobs, essentially wrapping them to call init scripts individually and tweaking the dependencies correctly.
Time spent hacking: 5+ hours. Ran into a lot of snags getting udev and filesystem mount ordered correctly, and each time I failed at that it meant needing a livecd!
The Victim: Me. Err, oh you meant the computer: Macbook Core 2 Duo 2.16, 2GB RAM, running Hardy.
Enjoyment: Infinite. This kind of nerdy thing keeps me going.
I'll get to bootchart in a moment, but bootchart doesn't tell the whole story -- what bootchart calls a bootup time and what the user sees as the bootup time are two entirely different things. These boot times are from a stopwatch from GRUB to login chime:
Native Upstart: 18s
SysV Upstart: 30s
Native Upstart: (22s) http://jdong.mit.edu/~jdong/macbook/...rt-upstart.png
SysV Upstart: (27s) http://jdong.mit.edu/~jdong/macbook/bootchart-sysv.png
(1) Note how slow my laptop hard drive is. Around 12MB/s is its peak read speeds. If I tried this with a powerful desktop hard drive, the 10 second long "readahead-list" could be shaved to 5 seconds or less.
(2) Ignore the first 17s of both bootup charts for the time being: Time spent probing modules and slurping readahead cannot be optimized by parallelized startup and are more or less hardware and kernel limitations on bootup speed. Focus on what's after the big blue trapezoid @ 15s: The actual time it took to set up dbus, hal, avahi, GDM, anacron, sysklog, and other system services. It took 5 seconds to do all of that on Upstart while SysV took over 10s. That's effectively doubling the speed at which services are coming up. In addition, notice how Upstart was more consistently able to break the one-core barrier of CPU usage.
For educational purposes, here's how I wrote my upstart events: http://jdong.mit.edu/~jdong/event.d.tar.gz
You're welcome to play with it all you want, but DO IT ON AN EXPERIMENTAL BOX. It's extremely easy for one typo or logic error to result in an unbootable system.
As a proof-of-concept, I "defragged" (rewrote rapidly) all the files readahead identified as being used at bootup, and got peak IO to around 15MB/s and upstart boot time to 19s by bootchart
EDIT 2: Youtube video of bootup: (note how rough around the edges it is )
Bootchart for this bootup: http://jdong.mit.edu/~jdong/macbook/...-defragged.png
EDIT 3: After some requests I am posting some dependency diagrams of my boot:
For comparison, SysV: http://jdong.mit.edu/~jdong/macbook/...t/sysv-dep.png
For the most part it fans out massively parallel quite well, which is encouraging news. Now, to optimize the longest chain length....
You can generate this diagram on your own system by grabbing http://jdong.mit.edu/~jdong/macbook/...rt/depchart.py and http://jdong.mit.edu/~jdong/macbook/...pchart-sysv.py
They don't come with manuals; figure it out
Last edited by jdong; March 18th, 2008 at 02:09 AM.