Re: Unexpected splice "always copy" behavior observed

Linus Torvalds
2010-05-20T14:22:15Z

On Wed, 19 May 2010, Mathieu Desnoyers wrote:
>
> Programs can use posix_fadvise() to announce an intention to access
> file data in a specific pattern in the future, thus allowing the kernel
> to perform appropriate optimizations.

It's true for some of them. The random-vs-linear behavior is a flag for
the future, for example (relevant for prefetching).

In fact, it's technically true even for DONTNEED. It's true that we won't
need the pages in the future! So we throw the pages away. But that means
that we throw the _current_ pages away.

If we actually touch pages later, than that obviously invalidates the fact
that we said 'DONTNEED' - we clearly needed them.

Linus