[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <cd8fd36b-eba7-039b-f823-f62d62c503b8@gmail.com>
Date: Wed, 21 Jul 2021 14:08:55 +0100
From: Dmitry Safonov <0x7f454c46@...il.com>
To: Dmitry Safonov <dima@...sta.com>, linux-kernel@...r.kernel.org
Cc: Alexander Viro <viro@...iv.linux.org.uk>,
Andrew Morton <akpm@...ux-foundation.org>,
Andy Lutomirski <luto@...nel.org>,
Brian Geffon <bgeffon@...gle.com>,
Catalin Marinas <catalin.marinas@....com>,
Chen Wandun <chenwandun@...wei.com>,
Dan Carpenter <dan.carpenter@...cle.com>,
Dan Williams <dan.j.williams@...el.com>,
Dave Jiang <dave.jiang@...el.com>,
Hugh Dickins <hughd@...gle.com>,
Ingo Molnar <mingo@...hat.com>, Jason Gunthorpe <jgg@...pe.ca>,
John Hubbard <jhubbard@...dia.com>,
Kefeng Wang <wangkefeng.wang@...wei.com>,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
Mike Kravetz <mike.kravetz@...cle.com>,
Minchan Kim <minchan@...nel.org>,
Ralph Campbell <rcampbell@...dia.com>,
Russell King <linux@...linux.org.uk>,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
Thomas Gleixner <tglx@...utronix.de>,
Vishal Verma <vishal.l.verma@...el.com>,
Vlastimil Babka <vbabka@...e.cz>,
Wei Yongjun <weiyongjun1@...wei.com>,
Will Deacon <will@...nel.org>
Subject: Re: [PATCH] mm/mremap: Don't account pages in vma_to_resize()
On 7/21/21 1:49 PM, Dmitry Safonov wrote:
> All this vm_unacct_memory(charged) dance seems to complicate the life
> without a good reason. Furthermore, it seems not always done right on
> error-pathes in mremap_to().
> And worse than that: this `charged' difference is sometimes
> double-accounted for growing MREMAP_DONTUNMAP mremap()s in move_vma():
> : if (security_vm_enough_memory_mm(mm, new_len >> PAGE_SHIFT))
>
> Let's not do this.
> Account memory in mremap() fast-path for growing VMAs or in move_vma()
> for actually moving things.
And this one is also wrong: the diff for growing vma should be accounted
for !MREMAP_DONTUNMAP too.
Sending v2...
Thanks,
Dmitry
Powered by blists - more mailing lists