Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3096593
  • 博文数量: 94
  • 博客积分: 2599
  • 博客等级: 少校
  • 技术积分: 990
  • 用 户 组: 普通用户
  • 注册时间: 2006-08-30 23:23
文章分类

全部博文(94)

文章存档

2012年(1)

2011年(7)

2010年(24)

2009年(61)

2008年(1)

我的朋友

分类: LINUX

2009-08-31 20:17:02

The items on this page constitute a list of existing techniques for reducing bootup times for embedded systems. Some of these items may also be applicable to desktop or enterprise systems, but that is not the focus.

For each individual item below, a separate page should exist. If it doesn't already exist, a new page should be created using the HowtoTemplate. Links listed in red below are pages that are not created yet. To sign up for a task related to this HOWTO, please see the .


Table Of Contents:

目录


Introduction

Bootup Phases

This document divides the bootup process into 3 main phases:

  • Firmware initialization phase
  • Kernel initialization phase
  • User Space initialization phase

User Space usually consists of a few distinct phases also:

  • Initialization scripts (RC scripts, for desktop systems)
    • This is where most daemons and services are loaded.
  • Graphics system initialization
  • Graphical environment start
  • Application initialization

Main Technique Types

Techniques presented here can be organized according to the way they try to achieve their effect. The technique can consist of 1) speeding up the activity 2) doing the activity in parallel with other initialization tasks, 3) doing the activity later (possibly after booting is completed), and 4) avoiding doing the activity at all.

In summary, each technique describes how to take an existing bootup activity and do one of:

  • Do it faster
  • Do it in parallel
  • Do it later
  • Don't do it at all

Some techniques will consist of multiple methods (such as both speeding up and doing it in parallel).

Bootup Time Reduction Technique Outline

Following is an outline of different bootup time reduction techniques, organized by the boot phase where they are applied.

Firmware Phase

Here ase some techniques for speeding up the Firmware phase of the boot sequence:

  • - Kernel Execute-In-Place

  • - Disable firmware features to eliminate diagnostics, memory counts, etc.

  • - Parallelize Hard Disk spinup with Kernel load

  • - Use DMA to copy kernel from flash to RAM

Kernel Phase

The following are techniques used to speed up the initialization of the kernel:

  • - Turn off serial console output during boot

  • - Use pre-set loops_per_jiffy (avoid calibrate_delay())

  • - Preconfigure some PCI bus slots

  • - Don't probe some IDE devices -

  • - Disable probes for non-existent devices (including keyboards, etc.)

  • - Use smallest kernel configuration possible

  • - Shorten device probes by reducing the amount of time the driver busywaits

    • A special case of this is , with IDE driver delays

  • - Perform threaded initialization - replace driver busywaits with yields

    • A special case of this is , with IDE driver busywaits

  • - Use modules where possible to move driver initialization later in the boot sequence

User Space Phase

The following are techniques for reducing the bootup time for user-space programs:

  • - Execute-In-Place for applications and librarys

  • - Eliminate unneeded RC scripts

  • - Use a custom initialization program

    • (This is a special case of eliminating unneeded RC scripts)
  • - Optimize RC script execution

  • - Execute RC scripts in parallel, instead of in sequence

  • - Avoid overhead of runtime link fixups during first program/library load

  • - Reduce writes to flash

  • - off logging to stable storage

  • - Use faster file system

  • - Use RAMDISK during boot

  • - Use a segmented file system to avoid interference between reads and writes

General Reduction Techniques

Some reduction techniques don't apply to a specific boot phase, but are general methods to reduce bootup time. These are listed here.

  • - Use smaller kernel and programs for faster load times

  • - Use faster system memory to increase load and initialization performance

Table of Reduction Techniques

The following table summarizes the various techniques listed in this document.

[I'm not sure if the table should replace the information listed in the outline above. I think the table is easier to read. - Tim Bird]

Technique

Boot Phase

Description

Observed reduction

Notes

Firmware

Kernel Execute-In-Place - avoids kernel copy and decompression time

250 ms

causes runtime performance loss

Firmware

Skip firmware probing features, like memory check, bus probing, and device detection, etc.

??

Linux re-probes busses and devices anyway, so this is usually waste of time

Firwmare

Start hard drive spin up before loading kernel

??

Not possible if the kernel is loaded from hard drive.

Firmware

Use DMA to copy kernel from flash to RAM

180 ms

.

Kernel

Use a hardcoded loops_per_jiffy value to avoid cost of calibration.

250 ms

.

Kernel

Avoid probing for non-existent keyboards and other devices

??

.

Kernel

Reduce kernel size and length of code paths, thereby reducing execution overhead

??

.

Kernel

Turn off output to serial console during boot

250 ms

.

Kernel

Preconfigure PCI bus slots on kernel command line

??

Is this even possible?

Drivers

Move drivers to modules and load them later in boot sequence.)

??

Only works for drivers that can be loaded as modules late in the boot cycle.

Drivers

Use "noprobe" on kernel command line for IDE driver

3 sec.

Depends on hardware present

Drivers

Reduce the length of driver busy waits

??

.

Drivers

Reduce length of IDE initialization delays

5 sec.

May be dangerous, depends on hardware

Drivers

Replace busywaits in drivers with yields

??

Only adds value if driver can be parallelized with some other init activity.

Drivers

Replace busywaits in IDE drivers with yields

250 ms (decreased non-preemptibility)

Already fixed in 2.6

RC scripts

Eliminate unneeded init scripts

3 sec.

Depends on required scripts

RC scripts

Start init scripts in parallel

??

.

RC scripts

Defer some init scripts to later in boot cycle

??

.

RC scripts

Use busybox, smaller shell, builtins, adjusted scripts

3 sec.

Depends on required scripts

RC scripts

Use custom initialization program (eliminating RC scripts altogether)

10 sec.

requires long-term maintenance of the program

User Space

Use Execute-In-Place for applications and libraries.

??

Requires uncompressed file system. Application performance may be reduced.

User Space

Keep read-only data separate from writable data in flash storage

??

.

User Space

Avoid writes to flash memory

??

.

User Space

Keep writable files in RAM, and write them to flash after boot

??

.

User Space

Use smallest programs and configurations possible

??

Reduces program load time. It may increase cache hits.

[General]

Use faster memory

??

.

.

Potential Techniques

Here is a list of potential techniques that have not been tried yet, to our knowledge:

  • Use different, faster, firmware
  • Cache results of find and grep during RC scripts
  • Partial XIP (this is a current project of the WG)
阅读(764) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~