--- a/mm/mremap.c~mm-mremap-fix-memory-account-on-do_munmap-failure +++ a/mm/mremap.c @@ -686,7 +686,7 @@ static unsigned long move_vma(struct vm_ if (do_munmap(mm, old_addr, old_len, uf_unmap) < 0) { /* OOM: unable to split vma, just get accounts right */ if (vm_flags & VM_ACCOUNT && !(flags & MREMAP_DONTUNMAP)) - vm_acct_memory(new_len >> PAGE_SHIFT); + vm_acct_memory(old_len >> PAGE_SHIFT); excess = 0; }