The 1-second-boot-time achievement came in three stages. The first stage was optimization in all the obvious places, including the boot loader. The team could eliminate some of the boot time in the boot loader because the hardware is the same for everything the system boots. The team also omitted many drivers the OS didn’t need and minimized the OS configuration. “Even [Linux founder] Linus Torvold admits that Linux is getting pretty bloated,” says Kaliadin. This first stage got the team members down to a 7-second boot time.
The second stage required an intimate knowledge of the hardware. The Linux boot loader is a serial process. The team’s epiphany came when the developers realized that they could use DMA (direct-memory-access) methods to parallel many tasks in the boot process.
The DMA agents can move many boot tasks between flash memory and the processor memory and can accomplish this task in the background without processor overhead. “These days, CPUs have a pretty large cache memory, so they are capable of doing all these things in parallel,” says Kaliadin. Using DMA and the processor cache saves 3 more seconds, which further reduces the optimized boot time to 4 seconds from 7.
The next logical place to reduce the boot was in the user’s application, but customers fix and determine that variable. The MontaVista team then looked at the loading of the customer’s applications. The developers could use the RAM disk that has been available in the Linux kernel since Revision 2.4, but Linux still cached that memory, and that process slowed things down. Since the development of the 2.6 kernel, Linux has supported loading the file system into this RAM disk. “We ditched the whole buffer scheme and just loaded the customer’s application into the Linux page-cache memory,” says Kaliadin.
The second part of this innovation was the developers’ realization that they didn’t have to load the customer’s entire application, just the parts that the initial application required to start up. That realization allowed the boot time to near 1 second. “We made some big advances but then had to find 100 milliseconds here and there,” he says.
Bookmarks