readahead - from a tar file

Scott James Remnant scott at netsplit.com
Mon Oct 22 21:51:54 BST 2007


On Mon, 2007-10-22 at 13:40 -0700, Shawn Rutledge wrote:

> Another idea I had over the weekend to speed up boot times is also
> related to reducing disk seek time.  I see that ubuntu already starts
> a "readahead" process before much else, to preload the necessary files
> into RAM.  This is an excellent idea, but those files are still
> potentially located all over the disk, right?  So seek time may be the
> dominant factor in that process.  What if it instead read the same
> files from a cache, in the form of an uncompressed tar file?  Then it
> would be a completely sequential, contiguous read.  And each time a
> file is completely loaded, an event could be fired.
> 
This would require kernel changes, since it would have to know that the
file being read is equivalent to another on the disk -- and you'd
actually need to know things like the inode/block numbers of the files
you're replacing!

Since you can't guarantee they won't change while the computer is off,
you need to double-check on boot.

So you lose the efficiency you were aiming for.


The most interesting thing is to actually reorder the filesystem so that
the blocks you need are always at the front and always sequential.

> The tar could be rewritten after each boot (as a "nice" process of
> course, and perhaps delayed).  readahead would simply have to notice
> somehow that different files are being read directly from disk rather
> than from the tarball (but it already does this during a "profile"
> operation, to re-write the list of files right?)  Each time the file
> list is different from the order of files in the tarball, it could
> re-write the tar.
> 
Profile is hideously expensive; the "prefetch" kernel patches are far
more interesting.

Scott
--
Have you ever, ever felt like this?
Had strange things happen?  Are you going round the twist?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/upstart-devel/attachments/20071022/9ae355cc/attachment.pgp 


More information about the upstart-devel mailing list