github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

mmeeks / sreadahead

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 2
    • 1
  • Source
  • Commits
  • Network (1)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

read ahead at boot to improve performance; from Intel. — Read more

  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

add manual 
mmeeks (author)
Fri Jan 29 07:35:01 -0800 2010
commit  7c300566b6dcb4b8eb17e71d7d15cbe45e470d2d
tree    be9ef68c95f734aabd877a03b3f86f192c3e13e5
parent  7b3d4318e6451e75f3094e5a5b5f6f28eb4bd65d
sreadahead /
name age
history
message
file .gitignore Tue Jan 26 07:01:44 -0800 2010 cleanup, and new kernel tracing patch [mmeeks]
file 0001-kernel-trace-open.patch Tue Jan 26 07:01:44 -0800 2010 cleanup, and new kernel tracing patch [mmeeks]
file COPYING Tue Jan 26 07:01:44 -0800 2010 cleanup, and new kernel tracing patch [mmeeks]
file Changelog Tue Aug 18 14:39:56 -0700 2009 add SSD detection, do things differently on HDD [mmeeks]
file Makefile Fri Jan 29 04:58:14 -0800 2010 add --dump functionality [mmeeks]
file README Tue Jan 26 07:01:44 -0800 2010 cleanup, and new kernel tracing patch [mmeeks]
file io-trace-patch.diff Fri Dec 04 10:19:15 -0800 2009 add updated kernel tracing patch for 2.6.31+ [mmeeks]
file sreadahead.1 Fri Jan 29 07:35:01 -0800 2010 add manual [mmeeks]
file sreadahead.c Fri Jan 29 07:34:40 -0800 2010 add really dumb hash to accelerate sorting & he... [mmeeks]
README
sreadahead - a readahead implementation optimized for solid state devices

---

How it works
============

Overview
--------

Seek times are nearly zero on SSD devices. However, it still takes
significant time to actually to the IO and get all the data needed
to boot the system into memory.  Since at boot we can't do anything
else but wait on this IO, we lose a lot of time.

Sreadahead attempts to eliminate all this IO wait time at boot by
reading all the needed pages from disk and into memory before they
are actually needed by the boot process.

During an initial boot process, we monitor which parts of the disk
contents are actually used. At a later boot, we can then read all
that information at the first start of the boot process.

Initial boot
------------

The initial boot is when we don't know which content is needed during
the boot phase. During this boot process, we cannot accelerate the
boot process, but we can monitor the boot process and determine which
content is read from disk, and create a list of this content to use
for subsequent boots.

Sreadahead implements this phase by starting a kernel tracer which
monitors open() syscalls in the kernel and storing them in the debugfs
trace buffer.  After the system is done booting, sreadahead processes
the trace content and writes out a pack file that will be read during
subsequent boots.

Subsequent boots
----------------

If sreadahead finds a pack file on the system at boot time, it will
open this pack file and start fetching all the needed files listed
in this pack into memory. Sreadahead minimizes the reads to data that
is actually needed, and will not read entire files if strictly needed.

Resetting the pack file
-----------------------

At one point in time, the pack file will reflect an out-of-date system
state that is no longer accurate. This will degrade the effectiveness
of sreadahead, and at such a point in time, the pack file should be
deleted, so that a new pack can be automatically generated.


---

How distributions should implement sreadahead.

Distributions packaging sreadahead should implement three components:

1) starting sreadahead as early as possible;
2) (optional) at the end of the boot sequence, signal sreadahead to
   generate it's pack file;
3) once in a while, remove the pack file so it can be refreshed.

Typically, the following line would be added to the top of
the "rc.sysvinit" script, or equivalent, such as "rcS" or "single" init.d
script.

  /sbin/sreadahead

This will make sreadahead fork into the background and load an existing
readahead.packed file, and then doing it's work.

Sreadahead will generate the pack file after 15 seconds automatically.
If this is too late, one can send sreadahead a SIGUSR1 signal at
any time before this 15 seconds, to make sreadahead immediately stop
tracing and create a pack file.

To update the pack file, one can simply remove /etc/readahead.packed and
reboot the system.

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server