linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] lower VM_DONTCOPY total_vm
@ 2005-07-11 18:14 Hugh Dickins
  0 siblings, 0 replies; only message in thread
From: Hugh Dickins @ 2005-07-11 18:14 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

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>
---

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

--- 2.6.13-rc2-mm1/kernel/fork.c	2005-07-07 12:33:21.000000000 +0100
+++ linux/kernel/fork.c	2005-07-11 18:47:33.000000000 +0100
@@ -210,8 +210,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;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-07-11 18:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-11 18:14 [PATCH] lower VM_DONTCOPY total_vm Hugh Dickins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).