[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [PATCH] Use FIBMAP to sort .list files before scanning



* Morten Hustveit:
> > This patch ensures that the package iterator used by
> > ensure_allinstfiles_available returns the packages sorted by their .list
> > file's physical location on the harddisk, greatly reducing drive head
> > movements.

On Sat, Sep 05, 2009 at 09:03:03AM +0000, Florian Weimer wrote:
> Have you tried using readdir() and sorting by the d_ino field?  That
> should be even faster for ext3 because you hit the inode in disk
> order.

I haven't tried this, because it would require much more changes to the dpkg
code.  The "FIBMAP every .list file" step takes less than one second when
operating from a cold disk cache, probably because inodes aren't as scattered
as file contents.

I did try to use posix_fadvise + POSIX_FADV_WILLNEED on the next file each time
iterpkgnext() was called, so that the kernel would be reading file N+1 while
dpkg was processing file N.  This cut approximately 0.5 seconds from my 8.0
second execution time; not a very interesting improvement in my opinion.


Reply to: