--o-direct option

Jamie Lokier jamie at shareable.org
Thu Feb 28 07:15:02 GMT 2008

Jerome Haltom wrote:
> The problem is that during the rsync process the user's machine is
> barely usable. The reason is because rsync reads these 2GB files... many
> GBs of them. This causes the user's machine to repeatidly trash the page
> cache. This really is Linux's fault. It should realize the relative
> priority of the two apps and prevent rsync from trashing the cache. But
> it doesn't.
> Allowing rsync to specific O_DIRECT would circumvent the page cache
> completely. Preventing the cache from being trashed.

On Linux, fadvise(POSIX_FADV_DONTNEED) trailing behind the read/write
position is more appropriate for this, I suspect.

It also has the advantage of working with all filesystem types on
Linux, which O_DIRECT does not.

However, there are times when O_DIRECT is useful, and I do use it in a
file copying application of mine to control cache memory.

-- Jamie

More information about the rsync mailing list