~ubuntu-branches/ubuntu/lucid/sreadahead/lucid

« back to all changes in this revision

Viewing changes to README

  • Committer: Bazaar Package Importer
  • Author(s): Scott James Remnant
  • Date: 2009-02-20 13:15:52 UTC
  • Revision ID: james.westby@ubuntu.com-20090220131552-h9uukunhsnztaasl
Tags: upstream-1.0
ImportĀ upstreamĀ versionĀ 1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
sreadahead - a readahead implementation optimized for solid state devices
 
2
 
 
3
---
 
4
 
 
5
How it works
 
6
============
 
7
 
 
8
Overview
 
9
--------
 
10
 
 
11
Seek times are nearly zero on SSD devices. However, it still takes
 
12
significant time to actually to the IO and get all the data needed
 
13
to boot the system into memory.  Since at boot we can't do anything
 
14
else but wait on this IO, we lose a lot of time.
 
15
 
 
16
Sreadahead attempts to eliminate all this IO wait time at boot by
 
17
reading all the needed pages from disk and into memory before they
 
18
are actually needed by the boot process.
 
19
 
 
20
During an initial boot process, we monitor which parts of the disk
 
21
contents are actually used. At a later boot, we can then read all
 
22
that information at the first start of the boot process.
 
23
 
 
24
Initial boot
 
25
------------
 
26
 
 
27
The initial boot is when we don't know which content is needed during
 
28
the boot phase. During this boot process, we cannot accelerate the
 
29
boot process, but we can monitor the boot process and determine which
 
30
content is read from disk, and create a list of this content to use
 
31
for subsequent boots.
 
32
 
 
33
Sreadahead implements this phase by starting a kernel tracer which
 
34
monitors open() syscalls in the kernel and storing them in the debugfs
 
35
trace buffer.  After the system is done booting, sreadahead processes
 
36
the trace content and writes out a pack file that will be read during
 
37
subsequent boots.
 
38
 
 
39
Subsequent boots
 
40
----------------
 
41
 
 
42
If sreadahead finds a pack file on the system at boot time, it will
 
43
open this pack file and start fetching all the needed files listed
 
44
in this pack into memory. Sreadahead minimizes the reads to data that
 
45
is actually needed, and will not read entire files if strictly needed.
 
46
 
 
47
Resetting the pack file
 
48
-----------------------
 
49
 
 
50
At one point in time, the pack file will reflect an out-of-date system
 
51
state that is no longer accurate. This will degrade the effectiveness
 
52
of sreadahead, and at such a point in time, the pack file should be
 
53
deleted, so that a new pack can be automatically generated.
 
54
 
 
55
 
 
56
---
 
57
 
 
58
How distributions should implement sreadahead.
 
59
 
 
60
Distributions packaging sreadahead should implement three components:
 
61
 
 
62
1) starting sreadahead as early as possible;
 
63
2) (optional) at the end of the boot sequence, signal sreadahead to
 
64
   generate it's pack file;
 
65
3) once in a while, remove the pack file so it can be refreshed.
 
66
 
 
67
Typically, the following line would be added to the top of
 
68
the "rc.sysvinit" script, or equivalent, such as "rcS" or "single" init.d
 
69
script.
 
70
 
 
71
        /sbin/sreadahead
 
72
 
 
73
This will make sreadahead fork into the background and load an existing
 
74
readahead.packed file, and then doing it's work.
 
75
 
 
76
Sreadahead will generate the pack file after 15 seconds automatically.
 
77
If this is too late, one can send sreadahead a SIGUSR1 signal at
 
78
any time before this 15 seconds, to make sreadahead immediately stop
 
79
tracing and create a pack file.
 
80
 
 
81
To update the pack file, one can simply remove /etc/readahead.packed and
 
82
reboot the system.
 
83