
INTRODUCTION
------------

readahead reads a list of files in advance and adds the pages to the page
cache.  The files are accessed and read in an efficient manner to minimize
disk seeks.  Best performance is achieved on an ext2 or ext3 file system.

The program works in three modes:

1) full mode

	readahead  /etc/readahead.d/*.early

   The program will read a new-line separated list of files from a text file.
   The files need not be in any special order. The following algorithm is used:

	   a) sort the file list by path
	   b) for each file:
	   	  - open(2),
		  - stat(2),
                  - retrieve first data block from the corresponding inode
	   c) sort the file list again
	   d) calling readahead(2) for each file


2) sort mode

	readahead  --sort --output=/etc/readahead.d/early.sorted /etc/readahead.d/*.early

   The program will read a new-line separated list of files from a text file.
   The files need not be in any special order. The same algorithm as for the "full
   mode" is used, but the sorted file list is written to stdout (or to --output=<file>).
   The program doesn't call readahead(2) in this mode.

   Hint: use this mode in your cron.d scripts (but be careful with things like prelink).

3) fast mode

	readahead  --dont-sort /etc/readahead.d/early.sorted

    The program will read a new-line separated list of files from a text file.
    The files need be in special order which is generated by the "sort mode". The
    program does the steps b) and d) described above.


READAHEAD-COLLECTOR
-------------------

The readahead collector allows to collect filenames of all files which are used
during boot process.  The goal is to generate effective and fully valid lists for
your machine. The collector is based on kernel audit system and collects
information about syscalls like open(), stat(), ...

For more information about settings see /etc/readahead.conf. Although
upstream supports starting the collector via the init= boot parameter,
the Debian package does recommend not using it as it doesn't provide
any further advantage to the init script-started mode.

To manually trigger the collector on next boot use

	touch /.readahead_collect

To manually trigger the collector on grub or any other boot loader that
supports passing parameters add the word 'profile' (without the quotes).

Note: the Debian package uses triggers in addition to a monthly and
daily cronjobs that are designed to keep a good performance without
user intervention.

WARNING: if you have auditd installed you have to disable it by removing its symlink
	from rcS.d. This because auditd deletes all audit rules during boot. That's
	contra-productive for the collector.

Update:
	If readahead-collector is started by upstart and if /.readahead_collect is
	present (which is created by a monthly cron job) the auditd and
	restorecond services startup is delayed.

CREDIT
------

Arjan van de Ven <arjan@infradead.org>
	- author of readahead idea

Ziga Mahkovec  <ziga.mahkovec@klika.si>
	- many performace improvements

Karel Zak <kzak@redhat.com>
	- upstream maintainer
	- author of readahead-collector


