mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-07 15:18:15 +00:00
[PATCH] mm acct accounting fix
This patch fixes mm->total_vm and mm->locked_vm acctounting in case when move_page_tables() fails inside move_vma(). Signed-Off-By: Kirill Korotaev <dev@sw.ru> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
202d182a92
commit
7179906293
1 changed files with 6 additions and 1 deletions
|
@ -224,6 +224,12 @@ static unsigned long move_vma(struct vm_area_struct *vma,
|
||||||
split = 1;
|
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) {
|
if (do_munmap(mm, old_addr, old_len) < 0) {
|
||||||
/* OOM: unable to split vma, just get accounts right */
|
/* OOM: unable to split vma, just get accounts right */
|
||||||
vm_unacct_memory(excess >> PAGE_SHIFT);
|
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;
|
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);
|
__vm_stat_account(mm, vma->vm_flags, vma->vm_file, new_len>>PAGE_SHIFT);
|
||||||
if (vm_flags & VM_LOCKED) {
|
if (vm_flags & VM_LOCKED) {
|
||||||
mm->locked_vm += new_len >> PAGE_SHIFT;
|
mm->locked_vm += new_len >> PAGE_SHIFT;
|
||||||
|
|
Loading…
Add table
Reference in a new issue