LinuxCon: A tale of two bootcharts
Posted Aug 26, 2010 22:26 UTC (Thu) by Jonno
In reply to: LinuxCon: A tale of two bootcharts
Parent article: LinuxCon: A tale of two bootcharts
What specifically is the slow part of modules? Having to suck them in individually?
Actually, modules loaded after rootfs is mounted isn't the problem. The problem is the initramfs, ormore acurately vmlinuz+initramfs . So simply building all modules normaly included in the initramfs into the kernel won't help either (well, you do loose the early userspace bits, which helps somewhat, but are neglible in the big picture). What you need is fewer modules to load prior to rootfs is mounted, and that can only be done by knowing the hardware in advance.
The problem is that vmlinuz and initramfs must be loaded prior to accessing the driver for your sata/pata/scsi/etc controller. There are special bios calls that let you do this, but those are crappy.
Each call only fetches a single block (512 bytes) and requires a pass through the kernel/bios boundary as well as a call to the harddrive.
A kernel/bios boundary is essentially the same as a userspace/kernel boundrary, but bioses are generally crappy, and will usually trash all register, most or all L1 cache, and up to 1MB of the L3 cache. Doing that thirty-five-thousands-and-thirty-seven (35,037) times (my Ubuntu netbook) can take a few seconds...
to post comments)