aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/fork.c
diff options
context:
space:
mode:
authorHuang Shijie <shijie8@gmail.com>2012-07-31 19:41:49 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-31 21:42:39 -0400
commit44de9d0cad41f2c51ef26916842be046b582dcc9 (patch)
treea9ce576f28e5038e9e3ae2e360cadf176dc74898 /kernel/fork.c
parentdf858fa8276f85106f2f5c3cd49c1fa524058070 (diff)
mm: account the total_vm in the vm_stat_account()
vm_stat_account() accounts the shared_vm, stack_vm and reserved_vm now. But we can also account for total_vm in the vm_stat_account() which makes the code tidy. Even for mprotect_fixup(), we can get the right result in the end. Signed-off-by: Huang Shijie <shijie8@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/fork.c')
-rw-r--r--kernel/fork.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index 8efac1fe56bc..aaa8813c45d1 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -381,10 +381,8 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
381 struct file *file; 381 struct file *file;
382 382
383 if (mpnt->vm_flags & VM_DONTCOPY) { 383 if (mpnt->vm_flags & VM_DONTCOPY) {
384 long pages = vma_pages(mpnt);
385 mm->total_vm -= pages;
386 vm_stat_account(mm, mpnt->vm_flags, mpnt->vm_file, 384 vm_stat_account(mm, mpnt->vm_flags, mpnt->vm_file,
387 -pages); 385 -vma_pages(mpnt));
388 continue; 386 continue;
389 } 387 }
390 charge = 0; 388 charge = 0;