From: Hugh Dickins Date: Tue, 12 Jul 2005 20:58:09 +0000 (-0700) Subject: [PATCH] lower VM_DONTCOPY total_vm X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=3b6bfcdb116f2cc2cab921fcac6d39d4022952d2;p=mv-sheeva.git [PATCH] lower VM_DONTCOPY total_vm 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/fork.c b/kernel/fork.c index cdef6cea890..b65187f0c74 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -208,8 +208,10 @@ static inline int dup_mmap(struct mm_struct * mm, struct mm_struct * oldmm) 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;