diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/mmap.c | 20 | ||||
-rw-r--r-- | mm/mprotect.c | 4 | ||||
-rw-r--r-- | mm/mremap.c | 4 |
3 files changed, 14 insertions, 14 deletions
@@ -832,7 +832,7 @@ none: | |||
832 | } | 832 | } |
833 | 833 | ||
834 | #ifdef CONFIG_PROC_FS | 834 | #ifdef CONFIG_PROC_FS |
835 | void __vm_stat_account(struct mm_struct *mm, unsigned long flags, | 835 | void vm_stat_account(struct mm_struct *mm, unsigned long flags, |
836 | struct file *file, long pages) | 836 | struct file *file, long pages) |
837 | { | 837 | { |
838 | const unsigned long stack_flags | 838 | const unsigned long stack_flags |
@@ -1110,7 +1110,7 @@ munmap_back: | |||
1110 | } | 1110 | } |
1111 | out: | 1111 | out: |
1112 | mm->total_vm += len >> PAGE_SHIFT; | 1112 | mm->total_vm += len >> PAGE_SHIFT; |
1113 | __vm_stat_account(mm, vm_flags, file, len >> PAGE_SHIFT); | 1113 | vm_stat_account(mm, vm_flags, file, len >> PAGE_SHIFT); |
1114 | if (vm_flags & VM_LOCKED) { | 1114 | if (vm_flags & VM_LOCKED) { |
1115 | mm->locked_vm += len >> PAGE_SHIFT; | 1115 | mm->locked_vm += len >> PAGE_SHIFT; |
1116 | make_pages_present(addr, addr + len); | 1116 | make_pages_present(addr, addr + len); |
@@ -1475,7 +1475,7 @@ static int acct_stack_growth(struct vm_area_struct * vma, unsigned long size, un | |||
1475 | mm->total_vm += grow; | 1475 | mm->total_vm += grow; |
1476 | if (vma->vm_flags & VM_LOCKED) | 1476 | if (vma->vm_flags & VM_LOCKED) |
1477 | mm->locked_vm += grow; | 1477 | mm->locked_vm += grow; |
1478 | __vm_stat_account(mm, vma->vm_flags, vma->vm_file, grow); | 1478 | vm_stat_account(mm, vma->vm_flags, vma->vm_file, grow); |
1479 | return 0; | 1479 | return 0; |
1480 | } | 1480 | } |
1481 | 1481 | ||
@@ -1610,15 +1610,15 @@ find_extend_vma(struct mm_struct * mm, unsigned long addr) | |||
1610 | * By the time this function is called, the area struct has been | 1610 | * By the time this function is called, the area struct has been |
1611 | * removed from the process mapping list. | 1611 | * removed from the process mapping list. |
1612 | */ | 1612 | */ |
1613 | static void unmap_vma(struct mm_struct *mm, struct vm_area_struct *area) | 1613 | static void unmap_vma(struct mm_struct *mm, struct vm_area_struct *vma) |
1614 | { | 1614 | { |
1615 | size_t len = area->vm_end - area->vm_start; | 1615 | long nrpages = vma_pages(vma); |
1616 | 1616 | ||
1617 | area->vm_mm->total_vm -= len >> PAGE_SHIFT; | 1617 | mm->total_vm -= nrpages; |
1618 | if (area->vm_flags & VM_LOCKED) | 1618 | if (vma->vm_flags & VM_LOCKED) |
1619 | area->vm_mm->locked_vm -= len >> PAGE_SHIFT; | 1619 | mm->locked_vm -= nrpages; |
1620 | vm_stat_unaccount(area); | 1620 | vm_stat_account(mm, vma->vm_flags, vma->vm_file, -nrpages); |
1621 | remove_vm_struct(area); | 1621 | remove_vm_struct(vma); |
1622 | } | 1622 | } |
1623 | 1623 | ||
1624 | /* | 1624 | /* |
diff --git a/mm/mprotect.c b/mm/mprotect.c index 57577f63b305..b426f01c5e9c 100644 --- a/mm/mprotect.c +++ b/mm/mprotect.c | |||
@@ -168,8 +168,8 @@ success: | |||
168 | vma->vm_flags = newflags; | 168 | vma->vm_flags = newflags; |
169 | vma->vm_page_prot = newprot; | 169 | vma->vm_page_prot = newprot; |
170 | change_protection(vma, start, end, newprot); | 170 | change_protection(vma, start, end, newprot); |
171 | __vm_stat_account(mm, oldflags, vma->vm_file, -nrpages); | 171 | vm_stat_account(mm, oldflags, vma->vm_file, -nrpages); |
172 | __vm_stat_account(mm, newflags, vma->vm_file, nrpages); | 172 | vm_stat_account(mm, newflags, vma->vm_file, nrpages); |
173 | return 0; | 173 | return 0; |
174 | 174 | ||
175 | fail: | 175 | fail: |
diff --git a/mm/mremap.c b/mm/mremap.c index f343fc73a8bd..55df8f53e84d 100644 --- a/mm/mremap.c +++ b/mm/mremap.c | |||
@@ -233,7 +233,7 @@ static unsigned long move_vma(struct vm_area_struct *vma, | |||
233 | * since do_munmap() will decrement it by old_len == new_len | 233 | * since do_munmap() will decrement it by old_len == new_len |
234 | */ | 234 | */ |
235 | mm->total_vm += new_len >> PAGE_SHIFT; | 235 | mm->total_vm += new_len >> PAGE_SHIFT; |
236 | __vm_stat_account(mm, vma->vm_flags, vma->vm_file, new_len>>PAGE_SHIFT); | 236 | vm_stat_account(mm, vma->vm_flags, vma->vm_file, new_len>>PAGE_SHIFT); |
237 | 237 | ||
238 | if (do_munmap(mm, old_addr, old_len) < 0) { | 238 | if (do_munmap(mm, old_addr, old_len) < 0) { |
239 | /* OOM: unable to split vma, just get accounts right */ | 239 | /* OOM: unable to split vma, just get accounts right */ |
@@ -384,7 +384,7 @@ unsigned long do_mremap(unsigned long addr, | |||
384 | addr + new_len, vma->vm_pgoff, NULL); | 384 | addr + new_len, vma->vm_pgoff, NULL); |
385 | 385 | ||
386 | current->mm->total_vm += pages; | 386 | current->mm->total_vm += pages; |
387 | __vm_stat_account(vma->vm_mm, vma->vm_flags, | 387 | vm_stat_account(vma->vm_mm, vma->vm_flags, |
388 | vma->vm_file, pages); | 388 | vma->vm_file, pages); |
389 | if (vma->vm_flags & VM_LOCKED) { | 389 | if (vma->vm_flags & VM_LOCKED) { |
390 | current->mm->locked_vm += pages; | 390 | current->mm->locked_vm += pages; |