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

[PATCH] Unaccount VM_DONTCOPY vmas properly

Unaccount VM_DONTCOPY vmas properly; the child inherits the whole of the
parent's virtual accounting from the memcpy() in copy_mm(), but the
VM_DONTCOPY check here is where a decision is made for the child not to
inherit the vmas corresponding to some accounted memory usages.  Hence,
unaccount them when skipping over them here.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 591e0fdb
......@@ -317,8 +317,11 @@ static inline int dup_mmap(struct mm_struct * mm, struct mm_struct * oldmm)
for (mpnt = current->mm->mmap ; mpnt ; mpnt = mpnt->vm_next) {
struct file *file;
if(mpnt->vm_flags & VM_DONTCOPY)
if (mpnt->vm_flags & VM_DONTCOPY) {
__vm_stat_account(mm, mpnt->vm_flags, mpnt->vm_file,
-vma_pages(mpnt));
continue;
}
charge = 0;
if (mpnt->vm_flags & VM_ACCOUNT) {
unsigned int len = (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT;
......
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