Linux Kernel/Boot Time: Difference between revisions

From Yocto Project
Jump to navigationJump to search
(Created page with '== Vision == Provide an example layer which demonstrates how to minimize the boot-time of the Intel N-450 Development platform. Using a core-image-minimal image, boot to a login …')
 
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Vision ==
== Vision ==
Provide an example layer which demonstrates how to minimize the boot-time of the Intel N-450 Development platform. Using a core-image-minimal image, boot to a login prompt in 2.0 seconds.
Provide an example layer which demonstrates how to minimize the boot-time of the Intel N-450 Development platform. Publish a document on how to apply the techniques used in the demonstration layer to an arbitrary BSP. Using a core-image-minimal image (or a customized version of it), boot to a login prompt in 2.0 seconds. Try to stick with configuration options and upstreamable patches as far as is possible. Further reduction in boot-time can be had with BSP specific hacks and hard-coding of certain initialization routines, but they should be a last resort as they are expensive to maintain.


== Design ==
== Design ==
The current linux-yocto kernel configuration does not focus on minimal boot time. Eliminating necessary Linux kernel config options will reduce the image size as well as the boot time. Various boot parameters can also have a significant impact. Identify specific items through exploration of:
The current linux-yocto kernel configuration does not focus on minimal boot time. Eliminating unnecessary Linux kernel config options will reduce the image size as well as the boot time. All drivers required for boot shall be built-in to the kernel, those needed after boot for applications or likely use cases can be relegated to modules. Various boot parameters can also have a significant impact. Identify specific items through exploration of:


* linux/scripts/bootgraph.pl
* linux/scripts/bootgraph.pl
Line 10: Line 10:
* survey of talks and papers on the subject
* survey of talks and papers on the subject
* research coreboot and other BIOS replacements for the N450
* research coreboot and other BIOS replacements for the N450
The boot process should look like the following:
<pre>
BIOS -> Loader -> Kernel -> Userspace -> basic init -> start apps -> module load
</pre>


The boot-time budget follows:
The boot-time budget follows:
* BIOS: 0.5s
* BIOS: 0.5s
** Assuming a BLDK or other custom fast-boot BIOS
* Kernel + Modules: 1s
* Kernel + Modules: 1s
* Init to prompt: 0.5s
* Init to prompt: 0.5s
== Next Steps ==
* what runs before start @ 0.38s
* e100_init_module (0.4s)
* [23]_async_port_probe (0.8s-1.3s)
* alsa_card_azx_init (0.4s)
* serial8250* (0.4s)
* Current total: 2.6s (2.2s without async_port)
* Possibly M3 work
** udev audit
** hardcode required /dev/* nodes
** remove unnecessary configurations from udev (SCSI, IB, etc.)
** start udev early, but delay the event handler and settling until after boot


== Resources ==
== Resources ==
* [http://git.kernel.org/?p=linux/kernel/git/dvhart/yocto/meta-boottime.git;a=summary Boot Time Layer]
* [http://git.kernel.org/?p=linux/kernel/git/dvhart/yocto/meta-boottime.git;a=summary Boot Time Layer]
* [http://www.slideshare.net/andrewmurraympc/elce-the ELC 2010: The Right Approach to Minimal Boot Times]
* [http://www.slideshare.net/andrewmurraympc/elce-the ELC 2010: The Right Approach to Minimal Boot Times]
* http://elinux.org/Boot_Time


== Journal ==
== Journal ==
=== Bootgraph Results ===
==== Initial State: 2.6.34 (UP), USB ====
[[File:n450-2.6.34-usb.png|400px|thumb|right]]
* Yocto 1.0
* Intel N-450
* USB flash boot media
* linux-yocto 2.6.34
* Total boot time: 28.72s
** Some 15 seconds is due to the default BIOS
* Bootgraph logged 12s
<br style="clear:both" />
==== 2.6.34 (SMT), SSD ====
[[File:n450-2.6.34-smt-ssd.png|400px|thumb|right]]
* Yocto 1.0
* Intel N-450
* SATA SSD boot media
* linux-yocto 2.6.34 w/ SMT
* Bootgraph logged 6.32s
** SSD saves some 6 seconds
<br style="clear:both" />
==== 2.6.34 (SMT), SSD, NOKMS ====
[[File:n450-2.6.34-smt-ssd-nokms.png|400px|thumb|right]]
* Yocto 1.0
* Intel N-450
* SATA SSD boot media
* Boot parameters: i915.modeset=0
* linux-yocto 2.6.34 w/ SMT
* Bootgraph logged 3.98s
** NOKMS saves some 2.36s
<br style="clear:both" />
==== 2.6.37 (SMT), SSD, NOKMS ====
[[File:n450-2.6.37-ssd-nokms-serial.png|400px|thumb|right]]
* Yocto 1.0+
* Intel N-450
* SATA SSD boot media
* Boot parameters: i915.modeset=0
* Bootgraph logged 4.05s
<br style="clear:both" />
==== 2.6.37 (SMT), SSD, NOKMS, No Serial ====
[[File:n450-2.6.37-ssd-nokms.png|400px|thumb|right]]
* Yocto 1.0+
* Intel N-450
* SATA SSD boot media
* Boot parameters: i915.modeset=0 console=tty0
** All others also have console=ttyS0,115200
* Bootgraph logged 2.39s
** no serial saves 1.66s
<br style="clear:both" />
== Notes ==
=== Discussion w/ Arjan ===
=== Discussion w/ Arjan ===
* Establish a budget
* Establish a budget
Line 31: Line 106:
** Kernel Mode Switching (KMS)
** Kernel Mode Switching (KMS)
** Eliminate UDEV
** Eliminate UDEV
=== Initial State ===

Latest revision as of 21:32, 23 June 2011

Vision

Provide an example layer which demonstrates how to minimize the boot-time of the Intel N-450 Development platform. Publish a document on how to apply the techniques used in the demonstration layer to an arbitrary BSP. Using a core-image-minimal image (or a customized version of it), boot to a login prompt in 2.0 seconds. Try to stick with configuration options and upstreamable patches as far as is possible. Further reduction in boot-time can be had with BSP specific hacks and hard-coding of certain initialization routines, but they should be a last resort as they are expensive to maintain.

Design

The current linux-yocto kernel configuration does not focus on minimal boot time. Eliminating unnecessary Linux kernel config options will reduce the image size as well as the boot time. All drivers required for boot shall be built-in to the kernel, those needed after boot for applications or likely use cases can be relegated to modules. Various boot parameters can also have a significant impact. Identify specific items through exploration of:

  • linux/scripts/bootgraph.pl
  • comparison with MeeGo .config
  • discussions with MeeGo leads
  • survey of talks and papers on the subject
  • research coreboot and other BIOS replacements for the N450

The boot process should look like the following:

BIOS -> Loader -> Kernel -> Userspace -> basic init -> start apps -> module load


The boot-time budget follows:

  • BIOS: 0.5s
    • Assuming a BLDK or other custom fast-boot BIOS
  • Kernel + Modules: 1s
  • Init to prompt: 0.5s

Next Steps

  • what runs before start @ 0.38s
  • e100_init_module (0.4s)
  • [23]_async_port_probe (0.8s-1.3s)
  • alsa_card_azx_init (0.4s)
  • serial8250* (0.4s)
  • Current total: 2.6s (2.2s without async_port)
  • Possibly M3 work
    • udev audit
    • hardcode required /dev/* nodes
    • remove unnecessary configurations from udev (SCSI, IB, etc.)
    • start udev early, but delay the event handler and settling until after boot

Resources

Journal

Bootgraph Results

Initial State: 2.6.34 (UP), USB

N450-2.6.34-usb.png
  • Yocto 1.0
  • Intel N-450
  • USB flash boot media
  • linux-yocto 2.6.34
  • Total boot time: 28.72s
    • Some 15 seconds is due to the default BIOS
  • Bootgraph logged 12s


2.6.34 (SMT), SSD

N450-2.6.34-smt-ssd.png
  • Yocto 1.0
  • Intel N-450
  • SATA SSD boot media
  • linux-yocto 2.6.34 w/ SMT
  • Bootgraph logged 6.32s
    • SSD saves some 6 seconds


2.6.34 (SMT), SSD, NOKMS

N450-2.6.34-smt-ssd-nokms.png
  • Yocto 1.0
  • Intel N-450
  • SATA SSD boot media
  • Boot parameters: i915.modeset=0
  • linux-yocto 2.6.34 w/ SMT
  • Bootgraph logged 3.98s
    • NOKMS saves some 2.36s


2.6.37 (SMT), SSD, NOKMS

N450-2.6.37-ssd-nokms-serial.png
  • Yocto 1.0+
  • Intel N-450
  • SATA SSD boot media
  • Boot parameters: i915.modeset=0
  • Bootgraph logged 4.05s


2.6.37 (SMT), SSD, NOKMS, No Serial

N450-2.6.37-ssd-nokms.png
  • Yocto 1.0+
  • Intel N-450
  • SATA SSD boot media
  • Boot parameters: i915.modeset=0 console=tty0
    • All others also have console=ttyS0,115200
  • Bootgraph logged 2.39s
    • no serial saves 1.66s


Notes

Discussion w/ Arjan

  • Establish a budget
  • Things to look at first
    • boot media
      • use SSD or MMC over Standard IO
      • avoid USB and spinning media
    • SATA
      • restrict ports to those being used
    • Kernel Mode Switching (KMS)
    • Eliminate UDEV