[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <hwz7y3jqi7ynxwtqzisrlo3zrdkdwlfb45nb4nixjcontpiry6@mdtki5al2no5>
Date: Thu, 17 Oct 2024 19:53:10 -0400
From: "Liam R. Howlett" <Liam.Howlett@...cle.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Jeff Xu <jeffxu@...omium.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>,
Pedro Falcato <pedro.falcato@...il.com>
Subject: Re: [PATCH 1/2] mm/mremap: Clean up vma_to_resize()
* Andrew Morton <akpm@...ux-foundation.org> [241017 17:08]:
> On Thu, 17 Oct 2024 11:15:20 -0700 Jeff Xu <jeffxu@...omium.org> wrote:
>
> > > > > -static struct vm_area_struct *vma_to_resize(unsigned long addr,
> > > > > +static int mremap_vma_check(struct vm_area_struct *vma, unsigned long addr,
> > > > The original function is vma_to_resize, and mremap_vma_check is
> > > > missing this context.
> > > > Maybe mremap_vma_check_resize is a better name ?
> > >
> > > Good point. That suggestion is long though. Perhaps
> > > vma_check_resize(), since this is a static function in the mremap.c
> > > file, it is fine to drop mremap from the name.
> > >
> > I'm ok with that.
>
> Any function with "check" in the name makes my teeth ache. "check"
> what? And the name doesn't carry any connotation of the return value's
> meaning.
>
> eg, "check_the_cheese()" versus "cheese_is_fresh()". The latter name
> tells you what is being checked and it tells you what a "true" return
> value means.
Fair enough, how about resize_is_valid()?
>
> Also, the dang function isn't documented.
I'll add that, thanks.
>
> Also, why is mremap_to() calling mremap_vma_check() without testing its
> return value? mremap_vma_check() doesn't actually alter anything, does
> it? If it does then it's misnamed.
That's an issue, I'll fix it.
Thanks,
Liam
Powered by blists - more mailing lists