On Thu, March 30, 2017 16:08, Paul Eggert wrote: > On 03/29/2017 04:32 PM, Carlo Alberto Ferraris wrote: >> The change itself should be pretty safe > > Alas, I've run into setups where using POSIX_FADV_SEQUENTIAL and > POSIX_FADV_DONTNEED slow things down. See, for example: > > https://github.com/jborg/attic/issues/252 > > Also, if we're going to use these flags, shouldn't it be > POSIX_FADV_NOREUSE instead of POSIX_FADV_DONTNEED? And shouldn't the > size be 0?
Carlo's revised patch doesn't use POSIX_FADV_DONTNEED. (It only uses POSIX_FADV_SEQUENTIAL and POSIX_FADV_WILLNEED.) As mentioned POSIX_FADV_NOREUSE is a no-op on Linux. I think it would be a good idea to add an option to tell tar whether to use POSIX_FADV_NOREUSE, POSIX_FADV_DONTNEED, or neither, since there may be cases where any of the three possibilities is best. Or maybe tar could read an environment variable to determine which to use?