[PATCH] mm: vm_stat_account unshackled
[deliverable/linux.git] / mm / mremap.c
index fc45dc9a617b013f4db5aea5fe7898bf6cd677b6..55df8f53e84d389d14410bd6db6858b9e439944e 100644 (file)
@@ -141,6 +141,10 @@ move_one_page(struct vm_area_struct *vma, unsigned long old_addr,
                        if (dst) {
                                pte_t pte;
                                pte = ptep_clear_flush(vma, old_addr, src);
+
+                               /* ZERO_PAGE can be dependant on virtual addr */
+                               pte = move_pte(pte, new_vma->vm_page_prot,
+                                                       old_addr, new_addr);
                                set_pte_at(mm, new_addr, dst, pte);
                        } else
                                error = -ENOMEM;
@@ -229,7 +233,7 @@ static unsigned long move_vma(struct vm_area_struct *vma,
         * since do_munmap() will decrement it by old_len == new_len
         */
        mm->total_vm += new_len >> PAGE_SHIFT;
-       __vm_stat_account(mm, vma->vm_flags, vma->vm_file, new_len>>PAGE_SHIFT);
+       vm_stat_account(mm, vma->vm_flags, vma->vm_file, new_len>>PAGE_SHIFT);
 
        if (do_munmap(mm, old_addr, old_len) < 0) {
                /* OOM: unable to split vma, just get accounts right */
@@ -380,7 +384,7 @@ unsigned long do_mremap(unsigned long addr,
                                addr + new_len, vma->vm_pgoff, NULL);
 
                        current->mm->total_vm += pages;
-                       __vm_stat_account(vma->vm_mm, vma->vm_flags,
+                       vm_stat_account(vma->vm_mm, vma->vm_flags,
                                                        vma->vm_file, pages);
                        if (vma->vm_flags & VM_LOCKED) {
                                current->mm->locked_vm += pages;
This page took 0.030593 seconds and 5 git commands to generate.