aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPetr Cermak <petrcermak@chromium.org>2015-02-20 10:00:26 +0000
committerRuchi Kandoi <kandoiruchi@google.com>2015-04-13 23:20:56 +0000
commit6daab3abbe37c5a81b87d36cfc6cbfc520867833 (patch)
treebdcf68b56ee6f40fe43ce0c3d7cd719d3b4cf90e /include
parentfb9517c6467354d0da60499a53096949a38e7da0 (diff)
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: I6bc63fcd5f5cdcc1c92aeec8b5abc8e3108d92b1
Diffstat (limited to 'include')
-rw-r--r--include/linux/mm.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 41e1fda77cf7..18a4997dcde7 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1351,6 +1351,11 @@ static inline void update_hiwater_vm(struct mm_struct *mm)
mm->hiwater_vm = mm->total_vm;
}
+static inline void reset_mm_hiwater_rss(struct mm_struct *mm)
+{
+ mm->hiwater_rss = get_mm_rss(mm);
+}
+
static inline void setmax_mm_hiwater_rss(unsigned long *maxrss,
struct mm_struct *mm)
{