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

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



* Morten Hustveit:

> 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.

Very interesting.  It turns out that I was wrong.  For really old
directories, sorting by inode number (obtained through readdir without
a separate stat call) does not really speed things up that much.
Sorting by block number is measurably faster.  Sorting by inode number
before determining the block number achieves only a minor additional
gain over using block numbers.

FIBMAP has one problem: it's potentially unsafe and it's guarded with
CAP_SYS_RAWIO.  FIEMAP doesn't require CAP_SYS_RAWIO, so it *should*
be safe, but the lack of the capapability check might be an oversight.


Reply to: