Readahead
Advanced readahead solutions for desktop and embedded systems
This is the home of our advanced readahead project. More details soon!
You can find the first details about our project on Ottawa Linux Symposium 2007 paper and presentation.
Kernel patch
These kernel patches allow to dump information about all the files accessed during system startup:
- Exact file chuncks read by applications: inode, major and minor number of the filesystem device, offset and size.
- Exact file pages accessed by demand paging in the kernel (offset and size).
- All programs executed by the system (used later as landmarks to see where we are in the boot process).
Such information is dumped in the kernel log, and can be obtained by writing this log to a serial console (use minicom -C at the other end of the cable to store the serial data into a file.
The latest versions of these patches can be found here.
readahead-blocks-digest script
This Python program is meant to be run on your development workstation, not on the target system. It takes the kernel log dump as input and does the below tasks:
- Converts the inode numbers into filenames. This is done by enumerating all the files on the root system (or on the mounted target filesystem image), and building a table of inode file names).
- Merges adjacent or overlapping reads in the same file.
- Outputs a list a accessed file blocks: sample.
- Outputs file block statistics: sample.
- Outputs the raw input data, with just inode numbers replaced by file names: sample.
The latest version of this script can be found here.
This script is still missing command line arguments. Until we improve this, you can just read the source.
readahead-blocks program
This is the C program which is used on the target system. It just needs the block file from the readahead-blocks-digest program. Example:
/sbin/readahead-blocks /etc/readahead/blocks
This program is typically executed at the beginning of your system startup scripts.
The latest version of this program can be found here.

