##(see the SpecSpec for an explanation) * '''Launchpad Entry''': UbuntuSpec:kernel-lucid-boot-performance * '''Created''': * '''Contributors''': * '''Packages affected''': == Summary == This spec covers the implementation of the kernel side features aiding boot performance, see [[FoundationsTeam/BootPerformance]] for the discussion and rational behind these changes. This topic was discussed in full in the various foundations and desktop sessions, no specific kernel session was held. == Implementation == The kernel contributes to boot time in a lot of ways. Its initial initialisation, the time taken to mount the rootfs, and finally contributions during system initialisation such as loading drivers and policies. === Kernel Init === The key benchmark for the kernel boot itself is how long it takes to get from grub calling the kernels entry point to it starting to execute userspace code, typically for Ubuntu this is starting initramfs processing to mount the root filesystem. Initial timing puts this phase at about 1.54s while moblin on comparable hardware is getting to userspace in 0.9s. A key component of the difference is the time taken to ''unwrap'' the initramfs. === Mounting Root === We perform a number of activities before mounting the root filesystem. The primary driver should be getting the rootfs itself mounted everything else is secondary. The least we carry in here the faster kernel initialisation will occur and the quicker we get to true userspace. Currently we load AppArmor profiles in the initramfs and again in the real root. The first one is now redundant and can be removed. === System Init === We load a number of key drivers during system initialisation. A key one is graphics as it is on the critical path for user experience and needed for the desktop. Any improvements in initialisation time will directly speed boot. == Actions == The full actions list is documented on the blueprint whiteboard. Any discussion and findings for specific actions will be recorded below. === Kernel Init: Review moblin configuration for performance === The moblin kernel was measured to initialise in about .9s whereas the default Ubuntu kernel was booting in about 1.5s (both on the Dell Mini 10v reference). Where does this difference come from? Using the kernel bootgraph utility we analysed our boot boot and comparing the configuration for those long running components to the moblin kernel. The major costs are populate_rootfs, pnpisa_init, piix_init and associated port probes. We know that moblin does not use an initramfs, and as we can see below isapnp is turned off in their config: {{{ config-generic:# CONFIG_ISAPNP is not set }}} Booting with no initramfs and with isapnp disabled on the command line I get a kernel init time of approximatly 0.8s. In short we can account in full for the kernel init performance difference from disabling both the initramfs and isapnp. We have an item to look at the initramfs and we are likely unable to do without isapnp for hardware support. === Kernel Init: investigate moving populate_rootfs to async === === Mount Root: Remove AppArmor init from initramfs === === System Init: Review moblin graphics initialisation fixes for performance === 1. [sconklin] Evaluate the following moblin patches [[http://people.canonical.com/~sconklin/mobp/|Patches can be found here]]: 1. moblin: make device init asyncronous 2. fastboot: remove "wait for all devices before mounting root" delay 3. Ordering - kms after sata in drivers/Makefile 4. Don't blank display 5. drm: remove root requirement from DRM_IOCTL_SET_VERSION (+ DRM_IOCTL_AUTH_MAGIC) 6. moblin: fix vblank delay on pipe disable 7. moblin: add a EDID cache === System Init: investigate readahead by inode number === === System Init: block cache population trigger tracking for ureadahead === ---- CategorySpec