When to use POSIX_FADV_DONTNEED (Re: Bug#605009: serious performance regression with ext4)
Ted Ts'o wrote:
> 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.
Hmm. Maybe file triggers could suppress DONTNEED. A nice side-effect
might be to encourage use of file triggers. :)
> 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.
Even then, documentation extracted to /usr/share/doc doesn't need to
be cached. I suppose some timing and tweaking would be needed.
The cases to optimize most for imho are
1) initial installation (would use --force-unsafe-io)
2) apt-get dist-upgrade; xterm
3) apt-get install openoffice.org; oowriter
4) apt-get build-dep <anything>; dpkg-buildpackage
since these are the most painful when they are slow.
So I agree, this is not cut and dry. But being able to use the same
function and have it (hopefully) do something roughly sane on a
variety of kernels is very appealing.
Jonathan
Reply to: