summaryrefslogtreecommitdiff
path: root/mm/mremap.c
diff options
context:
space:
mode:
author <jgarzik@pretzel.yyz.us>2005-06-04 03:54:56 (GMT)
committerJeff Garzik <jgarzik@pobox.com>2005-06-04 03:54:56 (GMT)
commit73561695b2e77473e353a5ae63bab81ed5098d8e (patch)
treed039affaa54d38985e41566e4d62e0aa6a170287 /mm/mremap.c
parent6f2f38128170814e151cfedf79532e19cd179567 (diff)
parent8be3de3fd8469154a2b3e18a4712032dac5b4a53 (diff)
downloadlinux-fsl-qoriq-73561695b2e77473e353a5ae63bab81ed5098d8e.tar.xz
Automatic merge of /spare/repo/linux-2.6/.git branch HEAD
Diffstat (limited to 'mm/mremap.c')
-rw-r--r--mm/mremap.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/mm/mremap.c b/mm/mremap.c
index 0dd7ace..ec7238a 100644
--- a/mm/mremap.c
+++ b/mm/mremap.c
@@ -224,6 +224,12 @@ static unsigned long move_vma(struct vm_area_struct *vma,
split = 1;
}
+ /*
+ * if we failed to move page tables we still do total_vm increment
+ * since do_munmap() will decrement it by old_len == new_len
+ */
+ mm->total_vm += new_len >> PAGE_SHIFT;
+
if (do_munmap(mm, old_addr, old_len) < 0) {
/* OOM: unable to split vma, just get accounts right */
vm_unacct_memory(excess >> PAGE_SHIFT);
@@ -237,7 +243,6 @@ static unsigned long move_vma(struct vm_area_struct *vma,
vma->vm_next->vm_flags |= VM_ACCOUNT;
}
- mm->total_vm += new_len >> PAGE_SHIFT;
__vm_stat_account(mm, vma->vm_flags, vma->vm_file, new_len>>PAGE_SHIFT);
if (vm_flags & VM_LOCKED) {
mm->locked_vm += new_len >> PAGE_SHIFT;