On Thu, 2009-07-23 at 20:56 -0700, Moussa A. Ba wrote:This patch makes the clear_refs proc interface a bit more versatile. It adds support for clearing either anonymous, file mapped pages or both.
echo 1 > /proc/pid/clear_refs clears ANON pages
echo 2 > /proc/pid/clear_refs clears file mapped pages
echo 3 > /proc/pid/clear_refs clears all pages
Selectively clearing pages has a measurable impact on performance as it decreases the number of page walks. We have been using this interface and this adds flexibility to the user space application implementing the reference clearing.
[adding David, the original instigator of clear_refs)
First, don't send 0 of 1 messages, especially for a single patch. It
makes Andrew curse and makes him more likely to consider other
employment possibilities. Instead incorporate highly useful info like
the above into your patch instead, preferably as docs and commit
descriptions.
Second, depending on how we've documented the behavior of this file,
this looks like it might break existing tools that are currently writing
'1' but expecting the behavior of '3'?