fs/proc/task_mmu.c: add user-space support for resetting mm->hiwater_rss (peak RSS)
authorPetr Cermak <petrcermak@chromium.org>
Wed, 18 Feb 2015 10:39:10 +0000 (10:39 +0000)
committerStricted <info@stricted.net>
Thu, 11 Oct 2018 16:03:52 +0000 (18:03 +0200)
commite1301c8fdd0f42ada2dfb03c9556badb63539135
tree42107ced4a7c14ce300b82213eb8f9501c964194
parentbb2e6a16925740cd5997d0883a67944e5e75bc9c
fs/proc/task_mmu.c: add user-space support for resetting mm->hiwater_rss (peak RSS)

Peak resident size of a process can be reset back to the process's
current rss value by writing "5" to /proc/pid/clear_refs.  The driving
use-case for this would be getting the peak RSS value, which can be
retrieved from the VmHWM field in /proc/pid/status, per benchmark
iteration or test scenario.

Origin:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=695f055936938c674473ea071ca7359a863551e7

[akpm@linux-foundation.org: clarify behaviour in documentation]
Signed-off-by: Petr Cermak <petrcermak@chromium.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Primiano Tucci <primiano@chromium.org>
Cc: Petr Cermak <petrcermak@chromium.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Change-Id: I543a7640639d9916e813af875003fe3ee3a6bfe0
Documentation/filesystems/proc.txt
fs/proc/task_mmu.c
include/linux/mm.h