
From: Hugh Dickins <hugh@veritas.com>

dup_mmap of a VM_DONTCOPY vma forgot to lower the child's total_vm.  (But
no way does this account for the recent report of total_vm seen too low.)

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 kernel/fork.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)

diff -puN kernel/fork.c~lower-vm_dontcopy-total_vm kernel/fork.c
--- 25/kernel/fork.c~lower-vm_dontcopy-total_vm	Mon Jul 11 16:38:28 2005
+++ 25-akpm/kernel/fork.c	Mon Jul 11 16:38:28 2005
@@ -208,8 +208,10 @@ static inline int dup_mmap(struct mm_str
 		struct file *file;
 
 		if (mpnt->vm_flags & VM_DONTCOPY) {
+			long pages = vma_pages(mpnt);
+			mm->total_vm -= pages;
 			__vm_stat_account(mm, mpnt->vm_flags, mpnt->vm_file,
-							-vma_pages(mpnt));
+								-pages);
 			continue;
 		}
 		charge = 0;
_
