FasterBoot

FasterBoot

Status

Introduction

Minimize the boot time of installed Ubuntu systems, from power-on to a usable desktop.

Rationale

Boot should ideally be as quick as possible, so we can get to their system ASAP. We are already twice as quick as Fedora at getting to a usable desktop, and either a bit quicker or on par with XP at getting there, depending on hardware, but we should be able to do better.

Scope and Use Cases

  • Identify the most time-consuming components of the boot process
  • Develop a strategy for decreasing boot time

Implementation Plan

  • Profile file opens with inotify to optimize readahead file list.
  • Most delay comes from networking startup and related scripts
  • Move screen-cleanup rcS.d script later if feasible.
  • background hwclock startup
  • ensure that depmod can either cache results or just not run every time

We should provide the user with an option to profile both their system startup and their session.

In the first case, this would touch a file which would cause readahead to start a trivial daemon rather than performing readahead; this would use inotify to establish exactly which files are opened during the rest of the boot process.

In the second case, the user could be requested to log out and log back in again. During the process we start the inotify daemon, log exactly which files are opened during their session start and write them into a file.

We then read these files into the page cache after we do the system readahead, and this means that the files will be fully read into the page cache by the time the user logs in. Network scripts will be run by the startup of the relevant network device, rather than unconditionally at boot time. dhcp-client should not sleep randomly; rip the code out that does this and test whether there are any side effects.

depmod should not run every boot. We need to test whether the generated files can be cached between boots, or whether we can generate the dependency information at shutdown.

Data Preservation and Migration

  • Issues with screen cleanup -- we may be deleting running sessions?

Packages Affected

  • screen

  • netbase

  • readahead-list

  • dhcp-client

  • util-linux (hwclock)

  • module-init-tools

User Interface Requirements

  • Be as fast as possible.

Outstanding Issues

  • Inotify – listener at start of boot processor, notify on /.
  • per-user readahead – for session startup.
  • Move screen cleanup (which is in rcS.d) -> later

  • Do not wait for dhcplient timeout if the link is down (NetworkMagic).

  • Move ntpdate, dhcplient etc, to network startup – don't run if no link is present (NetworkMagic).

UDU BOF Agenda

  • Smarter readahead
    • Find a way to read less (only what will actually be used)?
    • Use readahead(2)?
  • Ordering
    • Delay more init processes until after the display manager starts?
  • hotplug
    • Cache hotplug decisions?
    • Use modules.alias rather than modules.*map?
  • DHCP
    • dhclient sleeps for 2 seconds for no apparent reason; make it stop
    • Don't wait for DHCP to timeout if the link is down

UDU Pre-Work

  • Profile the existing boot process to determine how much wallclock time, CPU time and I/O are caused by each init script.
    • No obviously low-hanging fruit.


CategoryUdu CategorySpec

UbuntuDownUnder/BOFs/FasterBoot (last edited 2008-08-06 16:26:55 by localhost)