Boot speedup with readahead

Doug Ledford dledford at redhat.com
Mon Sep 8 01:11:56 UTC 2008


On Mon, 2008-09-08 at 00:52 +0200, Mark wrote:
> @Arjan,
> Can you tell if you made code adjustments to readahead? or didn't you
> use that (because you said "a form of")..
> And any other code adjustments..
> 
> Men.. just tell us how you did this ^_^

Hmm...well, first off the best way to speed up the kernel portion of the
boot process would be to identify all the kernel modules you load, and
load them in parallel.  You might need to tweak some of them to do
scheduled sleeps instead of busy loops when waiting for initialization
tasks to complete.  Then of course upstart and parallel service starts.

The biggest time waster in the boot process is serial initialization
delay waits.  Maybe you have a SCSI controller (the old parallel
kind ;-) that needs to scan for devices.  There is a 256ms timeout
(nominally) for each device *not* present on the bus.  If you have a
single disk on a wide bus, that's 14 timeouts you need to wait through
at 1/4 second each.  If you can have your net controllers, your USB
controllers, and other modules all doing this kind of stuff
simultaneously, you greatly speed up the boot process.  Thanks to udev,
persistent device naming, and being able to do things like set the eth
number by MAC address instead of order that the ethernet drivers are
loaded, you can really dump a lot of module loads into the kernel in
parallel and then just wait for them all to complete.  In that scenario
your total time wait is the time it takes your slowest module to
initialize (roughly).  Similarly with user space services.  Do the same
basic thing.

Readahead can be a tremendous help if you can actually start it before
all of the kernel modules are done initializing.  For instance, USB
devices have a settle delay before they are scanned, so starting
readahead as soon as the SATA driver and drive are up means the system
can be doing something useful while USB is finishing up.  However, I
suspect Arjan's system doesn't wait on any USB devices, so at most he
has host controllers but nothing slow to initialize.  Even just some USB
disks might be enough to blow that 5 second load time.

Am I close Arjan?

-- 
Doug Ledford <dledford at redhat.com>
              GPG KeyID: CFBFF194
              http://people.redhat.com/dledford

Infiniband specific RPMs available at
              http://people.redhat.com/dledford/Infiniband

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://listman.redhat.com/archives/fedora-devel-list/attachments/20080907/ce0db5a2/attachment.sig>


More information about the fedora-devel-list mailing list