bgamari.foss at gmail.com
Fri Feb 17 17:54:08 MST 2012
While going through an old todo list I found that these patches had fallen by
the way-side. About a year ago I initiated a discussion with the Linux
kernel folks regarding the lack of any useable fadvise support on the kernel
side. As a result, I was observing extremely poor performance on my server
after backup as executable pages were being swapped out in favor of data
waiting to be flushed to disk. This is an extremely poor trade-off in the case
of a backup but the user-mode had no way to communicate this to the kernel as few POSIX implementations had working implementations of fadvise.
While there was at least one attempt at making kernels' limited fadvise
implementations work for rsync, it was quite awkward and it was understandably
deemed inappropriate for merge. As a result of discussions with Minchan Kim and
KOSAKI Motohiro, Linux has had reasonable support for handling
POSIX_FADV_DONTNEED. In particular, issuing this hint will compel the kernel
to try reclaiming the affected pages more quickly, which should reduce memory
pressure by dirty pages.
The accompanying patches adds support for this hint when available. Currently
DONTNEED is issued unconditionally although it could be conditioned on a flag
if this is deemed more inappropriate.
More information about the rsync