Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 475408 - net-misc/rsync - Please add fadvise patch
Summary: net-misc/rsync - Please add fadvise patch
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL: http://insights.oetiker.ch/linux/fadv...
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2013-07-01 12:15 UTC by Thomas Deutschmann (RETIRED)
Modified: 2013-12-03 11:50 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Deutschmann (RETIRED) gentoo-dev 2013-07-01 12:15:18 UTC
Hi,

see the problem described in $URL. Think about a situation where you backup your servers everyday using rsync. With a vanilla rsync your system's page cache would be filled up with data you don't use and the data you really care of will be 'blown' away.

With the patch (http://tobi.oetiker.ch/patches/rsync-3.0.9-3-fadvise.patch - latest version from 16.01.2013) you can specify an option "--drop-cache" to advise your kernel not to cache the data you don't care of, so that the data you care of will be kept in cache.

Could be done by providing a useflag "fadvise".

Reproducible: Always
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2013-07-02 15:47:34 UTC
   "The new rsync functionality has been contributed to the rsync mainline and
    will appears in the patch directory of the rsync source archive along with
    the next version of rsync."

However, upstream says:

   "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 2 SpanKY gentoo-dev 2013-12-03 08:23:30 UTC
i tend to agree with upstream.  in some niche cases, this patch certainly makes sense (although i think the chosen flag name is terrible), but a different implementation (say via LD_PRELOAD) would be better.  for example, overriding the read() and write() funcs and doing posix_fadvise on them automatically.

the coding style in the patch also leaves a bit to be desired which tends to be an indicator of "this might not be the greatest code to ship".  and i don't really want to be the one to clean up/maintain it.

the good news is that rsync supports epatch_user, so it should be easy for you to add the patch to your own system in /etc/portage/patches/.
Comment 3 Holger Hoffstätte 2013-12-03 11:50:55 UTC
Just for reference, since I only now found it myself: one possible implementation of the LD_PRELOAD way of doing things can be found at https://github.com/Feh/nocache