mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
mm: account the total_vm in the vm_stat_account()
vm_stat_account() accounts the shared_vm, stack_vm and reserved_vm now. But we can also account for total_vm in the vm_stat_account() which makes the code tidy. Even for mprotect_fixup(), we can get the right result in the end. Signed-off-by: Huang Shijie <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
df858fa827
commit
44de9d0cad
5 changed files with 4 additions and 9 deletions
|
|
@ -260,7 +260,6 @@ static unsigned long move_vma(struct vm_area_struct *vma,
|
|||
* If this were a serious issue, we'd add a flag to do_munmap().
|
||||
*/
|
||||
hiwater_vm = mm->hiwater_vm;
|
||||
mm->total_vm += 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) {
|
||||
|
|
@ -497,7 +496,6 @@ SYSCALL_DEFINE5(mremap, unsigned long, addr, unsigned long, old_len,
|
|||
goto out;
|
||||
}
|
||||
|
||||
mm->total_vm += pages;
|
||||
vm_stat_account(mm, vma->vm_flags, vma->vm_file, pages);
|
||||
if (vma->vm_flags & VM_LOCKED) {
|
||||
mm->locked_vm += pages;
|
||||
|
|
|
|||
Loading…
Reference in a new issue