adventures in booting

Ziga Mahkovec ziga.mahkovec at klika.si
Wed Dec 1 02:59:58 UTC 2004


On Sun, 2004-11-28 at 20:49 -0500, David Zeuthen wrote:
> So, I've looked a bit more into the booting process and how to optimize
> it.

Great work!

> The results are pretty good I think, here is the general time line made
> with a wallclock
> 
> 00: exit grub; start booting the kernel
> 04: kernel prints audit()
> 11: initrd is mounted; Red Hat nash visible
>      mount / ro (normal initrd procedure)
> 13: start bootchart logging; start readahead of approx 193MB files
>      sleep until readahead is complete
> 24: readahead done; now
>      create /dev and modprobe (in background)
>      mount / rw, enable swap
>      start xfs
>      startx as user davidz in background
>      start messagebus
>      start hald
>      start acpid
>      start NetworkManager

Do you have an idea of how much kudzu, cups and syslogd would add to
these times?  rhgb too probably, or would it make sense to dump it
completely?

> 7. A number of things was started in parallel - I found that doing
>    readahead while running modprobe wasn't helping anything; in fact
>    it contributed negatively to performance (a bit to my surprise, I
>    guess because the kernel was busy).

You think it might make sense to try running readahead in background,
but after the modules are loaded?  Especially if the readahead list
could somehow coincide with the order of services started, to further
reduce seeking.
Or is readahead best left running alone?

> So, I think these numbers are good and there's still some room for
> improvement; e.g. it takes ten seconds from grub to when the initrd is
> mounted - surely the kernel can boot faster? It's after all 25% of the
> time spent from grub until I have usable desktop.

I did some experiments with bootchart logging in the initrd phase.
Packed the initrd image with bash, ps and a bunch of libraries and
started logging early in the nash script... only to find out that the
whole phase flies by in less than a second :)

I would like to visualize the kernel boot though.  But I'd need pointers
on what kind of data to collect, and how.

> Thanks a lot to Ziga Mahkovec for the bootchart software - it's been
> very useful.

BTW, I've had loads of fun with SVG lately, so you might want to try
regenerating these charts.  Makes them scalable and about 15x smaller in
file size.  Have a look at the SVG samples (rsvg does a pretty good
job):
http://www.klika.si/ziga/bootchart/#Samples

-- 
Ziga




More information about the devel mailing list