[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKbZUD3YLqWOyN7t8d9x3drJBJFSQw0O9dq7reY2p-gQ-wen5Q@mail.gmail.com>
Date: Tue, 22 Oct 2024 23:08:17 +0100
From: Pedro Falcato <pedro.falcato@...il.com>
To: "Liam R. Howlett" <Liam.Howlett@...cle.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
Jann Horn <jannh@...gle.com>, David Hildenbrand <david@...hat.com>,
Qi Zheng <zhengqi.arch@...edance.com>, Kefeng Wang <wangkefeng.wang@...wei.com>,
Jeff Xu <jeffxu@...omium.org>
Subject: Re: [PATCH v2 1/2] mm/mremap: Clean up vma_to_resize()
On Fri, Oct 18, 2024 at 6:41 PM Liam R. Howlett <Liam.Howlett@...cle.com> wrote:
>
> From: "Liam R. Howlett" <Liam.Howlett@...cle.com>
>
> vma_to_resize() is used in two locations to find and validate the vma
> for the mremap location. One of the two locations already has the vma,
> which is then re-found to validate the same vma.
>
> This code can be simplified by moving the vma_lookup() from
> vma_to_resize() to mremap_to() and changing the return type to an int
> error.
>
> Since the function now just validates the vma, the function is renamed
> to resize_is_valid() to better reflect what it is doing.
Small nit: Could we pick a stable naming scheme?
I understand the kernel has historically had plenty of ways to name
functions, including
do_stuff
is_stuff
stuff_do
stuff_is
I thought we were starting to converge into vma_/vmi_/vms_ :(
I would personally prefer vma_resize_is_valid/vma_resize_valid (even
if it's a static function, so it doesn't matter _too_ much).
Anyway, enough bikeshedding...
>
> This commit also adds documentation about the function.
>
> Signed-off-by: Liam R. Howlett <Liam.Howlett@...cle.com>
Reviewed-by: Pedro Falcato <pedro.falcato@...il.com>
This patch made me realize there's a couple of small improvements we
can still do (maybe with a vmi) to clean up and speed up mremap (at
least!). I'll look into those if I find some time.
--
Pedro
Powered by blists - more mailing lists