Commit 591e0fdb authored by William Lee Irwin III's avatar William Lee Irwin III Committed by Linus Torvalds

[PATCH] /proc/pid/statm accounting fixes

Account reserved memory properly as per acahalan's speecified semantics.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 323d129f
......@@ -19,7 +19,7 @@ char *task_mem(struct mm_struct *mm, char *buffer)
"VmStk:\t%8lu kB\n"
"VmExe:\t%8lu kB\n"
"VmLib:\t%8lu kB\n",
mm->total_vm << (PAGE_SHIFT-10),
(mm->total_vm - mm->reserved_vm) << (PAGE_SHIFT-10),
mm->locked_vm << (PAGE_SHIFT-10),
mm->rss << (PAGE_SHIFT-10),
data << (PAGE_SHIFT-10),
......
......@@ -225,7 +225,7 @@ struct mm_struct {
unsigned long start_brk, brk, start_stack;
unsigned long arg_start, arg_end, env_start, env_end;
unsigned long rss, total_vm, locked_vm, shared_vm;
unsigned long exec_vm, stack_vm, def_flags;
unsigned long exec_vm, stack_vm, reserved_vm, def_flags;
unsigned long saved_auxv[40]; /* for /proc/PID/auxv */
......
......@@ -750,6 +750,8 @@ void __vm_stat_account(struct mm_struct *mm, unsigned long flags,
mm->stack_vm += pages;
if (flags & VM_EXEC)
mm->exec_vm += pages;
if (flags & (VM_RESERVED|VM_IO))
mm->reserved_vm += pages;
}
#endif /* CONFIG_PROC_FS */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment