readahead changes

Scott James Remnant scott at ubuntu.com
Wed Sep 20 05:33:35 BST 2006


The observant will notice that readahead has been changed in edgy, here
is the rationale.

                 |  readahead in bg  |  readahead in fg 
                 | unsorted | sorted | unsorted | sorted
  ---------------+----------+--------+----------+--------
  With old lists | 47.5s    | 46.5s  | 46s      | 45.5s
  With new lists | 46.5s    | 46s    | 45.5s    | 44.5s

The boot time without readahead at all was 51.5s


These times were generated as follows:

 - the machine was my laptop, a fairly typical P-M which had been
   installed with dapper and upgraded through edgy

 - software was current as of yesterday, and no changes were made during
   the testing

 - each test boot was performed three times and the average taken


The tests were:

 - "with old lists" means that the readahead list was taken from the
   current readahead package, generated around dapper time

 - "with new lists" means that the readahead list was generated from a
   fresh Knot 3 installation (inside VMware on another machine)

 - "readahead in bg" means that readahead was run, as is currently the
   case, in the background alongside the rest of the boot process

 - "readahead in fg" means that readahead was instead run in the
   foreground, blocking the rest of the boot process until it was
   complete.

 - "unsorted" means that the lists were taken straight from the Knot 3
   install, and were therefore in the block order of a fresh install
   (not an upgraded-through-edgy install)

 - "sorted" means that a patch was applied to readahead to sort the file
   list into block order before processing


Results:

 - first obvious result is that readahead is a win, even if
   sub-optimally configured;  we gain 4s by just keeping it and not
   changing it

 - regenerating the list is a definite win, it gains about a second

 - sorting the list every time appears to be a win, the cost of doing so
   is small and usually offset by the improvement gained as the disk is
   read in order and not seeked randomly

 - running readahead in the foreground, instead of the background, also
   appears to be a win.  This is because readahead can now just slurp
   the disk in order, and then let the boot process continue with
   everything loaded into memory.  Previously it was trying to slurp
   while the boot process was also loading things, and generally getting
   in each other's way.


The fastest option in the table is the one we will ship for edgy.  This
is a full 7s faster than not using readahead at all, and a 3s
improvement on what we have now.

So to summarise the changes:

 - readahead lists have been regenerated from a Knot 3 install (they can
   be improved nearer the release)

 - lists are sorted into block order on each boot, rather than when
   generated

 - readahead is run in the foreground


http://people.ubuntu.com/~scott/bootcharts/edgy-20060920-21.png


Scott
-- 
Scott James Remnant
scott at ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/ubuntu-devel/attachments/20060920/7f0e59d2/attachment.pgp 


More information about the ubuntu-devel mailing list