Bug 7004 - Use posix_fadvise to free cached file contents when done
Summary: Use posix_fadvise to free cached file contents when done
Status: RESOLVED WONTFIX
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 3.0.6
Hardware: All Linux
: P3 enhancement (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-21 14:56 UTC by Ted Percival
Modified: 2018-10-24 07:29 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ted Percival 2009-12-21 14:56:57 UTC
It would be good if rsync used posix_fadvise with POSIX_FADV_DONTNEED to notify the kernel when it no longer needs file contents that have been synced to prevent useful cache contents being dropped in favor of never-reused rsynced files.

Tobias Oetiker wrote a patch & documentation about this:
  http://insights.oetiker.ch/linux/fadvise.html
Comment 1 Ben Gamari 2010-11-03 07:54:13 UTC
What is the status of this? Grepping the source for fadvise turns up nothing. It seems the patch has even been ported up to 3.0.7 [1]

[1] http://tobi.oetiker.ch/patches/rsync-3.0.7-fadvise.patch
Comment 2 Wayne Davison 2010-11-06 11:03:40 UTC
I don't feel this patch is general enough nor straight-forward enough to make it into rsync.  It would be better for someone to write a a pre-load library that could be used with any copy program rather than putting this into rsync.
Comment 3 Arkadiusz Miskiewicz 2018-10-24 07:29:41 UTC
The rsync filling up kernel cache is a problem on bigger backup servers. These days POSIX_FADV_DONTNEED is commonly implemented in unix systems.

Anyway as temporary/not optimal workaround: https://github.com/Feh/nocache (if not wanting to patch rsync).