Boot-time improvements

Tristan Wibberley tristan at wibberley.org
Sun Sep 14 14:10:28 UTC 2008


On Thu, 2008-09-11 at 12:51 +0200, Krzysztof Lichota wrote:
> 2008/9/11 Timo Jyrinki <timo.jyrinki at gmail.com>:
> > 2008/9/10 Przemysław Kulczycki <przemekkulczycki at gmail.com>:
> >> Maybe we could achieve it using Prefetch?
> >> https://wiki.ubuntu.com/DesktopTeam/Specs/Prefetch
> >> https://wiki.ubuntu.com/AutomaticBootAndApplicationPrefetchingSpec
> >
> > Prefetch would be nice, and definitely would improve the user
> > experience. In the end, it would however not fix the problem with
> > seeking to thousands of different files / positions. The only way to
> > fix that problem is to go with sequential, big files, either by
> > precisely reordering stuff on the disk in an area that can be made
> > 100% sequential, or by copying files to a "cache" of sort, being a
> > single sequential file which contains everything needed and is updated
> > when needed.
> 
> As an author of Prefetch, I cannot agree that it would not fix seeks ;)
> Part of my implementation, not enabled by default as it is highly
> experimental, is ext3 defragmenter which puts all files for prefetch
> in one place on disk, so the requests to read them can be merged into
> big streaming reads.

There could be an automatic algorithm for this if done inside the
filesystem. If there is a "last-read" counter in the filesystem kernel
object then the filesystem can pick a pseudorandom number n on some
histogram chosen empirically and set last-read to the nth block read,
then pick a new pseudo random number m and move the mth block next to
the "last-read" one from earlier. then repeat with a new n and m. set
last-read to the start of the disk to begin with and start with
selecting an "m" to move and your filesystem will tend to gather
time-related files in space.

After several boots you'll have a boot-up and login readahead tailored
specifically to your typical use case. This would have practically no
discernable overhead or dead-time and requires very little system
analysis by humans. It is also something that Ubuntu could very easily
give back by delivering to upstream.

-- 
Tristan





More information about the Ubuntu-devel-discuss mailing list