Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
80 • <strong>Linux</strong> Symposium 2004 • Volume <strong>One</strong><br />
• start_kernel()<br />
– init architecture<br />
– init interrupts<br />
– init memory<br />
– start idle thread<br />
– call rest_init()<br />
*<br />
start ‘init’ kernel thread<br />
<strong>The</strong> init kernel thread performs a few<br />
other tasks, then calls do_basic_setup(),<br />
which calls do_initcalls(), to run<br />
through the array of initialization routines for<br />
drivers statically linked in the kernel. Finally,<br />
this thread switches to user space by execveing<br />
to the first user space program, usually<br />
/sbin/init.<br />
• init (kernel thread)<br />
– call do_basic_setup()<br />
*<br />
call do_initcalls()<br />
· init buses and drivers<br />
– prepare and mount root filesystem<br />
– call run_init_process()<br />
*<br />
call execve() to start user<br />
space process<br />
3 Typical Desktop Boot Time<br />
<strong>The</strong> boot times for a typical desktop system<br />
were measured and the results are presented<br />
below, to give an indication of the major areas<br />
in the kernel where time is spent. While the<br />
numbers in these tests differ somewhat from<br />
those for a typical embedded system, it is useful<br />
to see these to get an idea of where some of<br />
the trouble spots are for kernel booting.<br />
3.1 System<br />
An HP XW4100 <strong>Linux</strong> workstation system<br />
was used for these tests, with the following<br />
characteristics:<br />
• Pentium 4 HT processor, running at 3GHz<br />
• 512 MB RAM<br />
• Western Digital 40G hard drive on hda<br />
• Generic CDROM drive on hdc<br />
3.2 Measurement method<br />
<strong>The</strong> kernel used was 2.6.6, with the KFI patch<br />
applied. KFI stands for “<strong>Kernel</strong> Function Instrumentation”.<br />
This is an in-kernel system<br />
to measure the duration of each function executed<br />
during a particular profiling run. It<br />
uses the -finstrument-functions option<br />
of gcc to instrument kernel functions<br />
with callouts on each function entry and exit.<br />
This code was authored by developers at MontaVista<br />
Software, and a patch for 2.6.6 is available,<br />
although the code is not ready (as of the<br />
time of this writing) for general publication.<br />
Information about KFI and the patch are available<br />
at:<br />
http://tree.celinuxforum.org/pubwiki<br />
/moin.cgi<br />
/<strong>Kernel</strong>FunctionInstrumentation<br />
3.3 Key delays<br />
<strong>The</strong> average time for kernel startup of the test<br />
system was about 7 seconds. This was the<br />
amount of time for just the kernel and NOT the<br />
firmware or user space. It corresponds to the<br />
period of time between events 4 and 5 in the<br />
boot sequence listed in Section 2.