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

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



Guillem Jover <guillem@debian.org> writes:

> Hi Morten!
>
> On Sat, 2009-09-05 at 01:34:50 +0200, Morten Hustveit wrote:
>> When running dpkg from a cold cache on a system where /var/lib/dpkg/info/ lies
>> on a harddisk, a lot of time is spent waiting for seeks between (typically)
>> thousands of files.  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.
>> 
>> The performance improvement is around 330% on my system: reinstalling a simple
>> package takes 8 seconds instead of 27 seconds.  I dropped the caches before
>> each run, and did 10 runs with consistent results.
>
> Ah, nice speed up! Although mid term I'd prefer a portable solution
> that benefits all architectures in a similar way, and not just Linux.
>
> On kFreeBSD there's FIOGETLBA, but it seems to only be implemented for
> the cd9660 file system, so not of much use. Also AFAIU from taking a
> look at Linux, FIBMAP is being phased out by FIEMAP?

Wouldn't it be better to read the files asynchronous and let the
underlying elevator code sort them into physical block order?

Or will the shear number of files overwhelm the AIO layer and elevator
code?

MfG
        Goswin

PS: How much does backup+restore of /var/lib/dpkg/info give you and
how much does the ordering give you after that?


Reply to: