Re: Bug#605009: serious performance regression with ext4
On Mon, Nov 29, 2010 at 09:21:44AM -0600, Jonathan Nieder wrote:
>
> That explanation helps a lot. Thanks, both. (Guillem, I like your
> patch very much then. Most files being unpacked in a dpkg run aren't
> going to be read back again soon. Perhaps some other kernels will
> also interpret it as a hint to start writeback.)
Most files won't, but consider a postinstall script which needs to
scan/index a documentation file, or simply run one or more binaries
that was just installed. I can definitely imagine situations where
using POSIX_FADV_DONTNEED could actually hurt performance. Is it
enough to worry about? Hard to say; for a very long dpkg run, the
files might end up getting pushed out of memory anyway. But if you
are only installing one package, and you are doing this on a
particularly slow disk, using POSIX_FADV_DONTNEED could actually hurt
in a measurable way.
If you are only installing a one or a few packages, and/or you can
somehow divine the user's intention that they will very shortly use
the file --- for example, if dpkg is being launched via packagekit to
install some font or codec, then using POSIX_FADV_DONTNEED is probably
the wrong answer. So at the very least I'd recommend having command
line options to enable/disable use of posix_fadvise().
Regards,
- Ted
Reply to: