At the recently held Linux Plumbers’ Conference, 2 Linux developers, Arjan van de Ven and Auke Kok, demonstrated a Linux system booting in five seconds flat. To demonstrate this, they used an Asus EEE PC using a modified Fedora and modified Moblin. In-fact the bootup was so fast that the they actually had to hold the EEE PC, as the bootup was completed well before the projector could warm up and sync.
To achieve this, they had to look up and identify what was slowing down the system, for this they used a tool, Bootchart, by Ziga Mahkovec, which displays the order of the booting sequence, which modules are taking how much time amongst other details.
What’s taking so much time?
From the bootchart analysis, the following time-wasting components were identified:
- 1 Full Second in starting the loopback device and checking if all network interfaces are loopback
- 2 seconds to start sendmail
- Specifically in Fedora, setroubleshootd, atool used to find problems with Security Enhanced Linux configuration – which took up 5 seconds
- Splashscreens taking up some extra precious seconds
- In Ubuntu, modprobe took another 12 seconds, adding of license restricted drivers another 2.5 seconds, and Ubuntu’s GDM taking 2.5 seconds to display the background image
How did they do it ?
Ajan and Aike did some changes to the way modules are being loaded, mainly
- All modules required for boot were built into kernel, so that the time is not wasted in modprobe-ing
- Incorporating ACHI changes and starting ACHI and UHCI initialization at the some time
- Inclusion of a patch to support readahead, so that kernel keeps track of which blocks to read at boot, and makes it available when booting
- Changing the order of tasts that init handles , so that the following three things are done at the same time
- a readahead process to read blocks from disk so that they’re cached in memory
- the filesystem check
- starting of HAL and udev for hot-plugged devics
- Making lot of changes to X, to cut startup time