[rfc] boot-time async readahead...

Scott James Remnant scott at canonical.com
Thu Feb 12 14:46:17 GMT 2009

On Thu, 2009-02-12 at 00:44 -0500, John Moser wrote:

> On 2/11/09, Daniel J Blueman <daniel.blueman at gmail.com> wrote:
> > By modifying the boot-time readahead to be at lower I/O and processor
> > priority than the boot scripts and asynchronous, I see a 20% reduction
> > in overall boot time (from installing bootchart) on my desktop: 41s
> > down to 33s.
> A while back I pointed out that the file list for read-ahead was
> sorted by block rather than boot sequence; and that by leaving it
> sorted by boot sequence (i.e. first read == first need) and
> parallelling it you would necessarily have exactly two states:  1)
> waiting for a file readahead is trying to read anyway; 2) readahead is
> ahead of you because the rest of the boot process has spent some time
> CPU bound and not touching I/O.  Also, it's likely as soon as you
> enter state (2) that you stay there-- which is to say, almost
> immediately.
Not true at all.

Remember that in the rotary disk case, it's not just I/O wait that kills
you, but it's also the seek time of the disk.

If the readahead list is sorted in need order, and run alongside other
I/O activity, the disk is seeking all over the place.

When sorted by block order, and run in one pass, the seek time should be

Again, this all depends on _your_ disk.

Nobody other than Martin is following up with bootcharts[0] -- and his
shows that parallel is a little worse then sync.

The archives of ubuntu-devel will show my own investigation on this at
the time.  In summary:

Sync is *always* better than no readahead at all.
Parallel is *sometimes* better than no readahead, but in various cases
is actually _worse_.
When Parallel is not worse then no readahead, it is better than sync.

Since the out-of-the-box has to work for everyone, I chose sync.

If you have a very fast rotary disk (which Martin doesn't :p) or SSD,
you definitely want parallel.  But I'd then also recommend using
sreadahead instead of readahead-list.

I have some packages of sreadahead pending upload; but they require a
kernel patch.


[0] though I should follow up with Martin OOB, because there's something
very wrong with his machine ;)
Scott James Remnant
scott at canonical.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/ubuntu-motu/attachments/20090212/d91a4db8/attachment.pgp 

More information about the Ubuntu-motu mailing list