From: "Liam R. Howlett" <Liam.Howlett@oracle.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Jeff Xu <jeffxu@chromium.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
Jann Horn <jannh@google.com>,
David Hildenbrand <david@redhat.com>,
Qi Zheng <zhengqi.arch@bytedance.com>,
Kefeng Wang <wangkefeng.wang@huawei.com>,
Pedro Falcato <pedro.falcato@gmail.com>
Subject: Re: [PATCH 1/2] mm/mremap: Clean up vma_to_resize()
Date: Thu, 17 Oct 2024 19:53:10 -0400 [thread overview]
Message-ID: <hwz7y3jqi7ynxwtqzisrlo3zrdkdwlfb45nb4nixjcontpiry6@mdtki5al2no5> (raw)
In-Reply-To: <20241017140813.fe555ec947b17dd035e4c0d7@linux-foundation.org>
* Andrew Morton <akpm@linux-foundation.org> [241017 17:08]:
> On Thu, 17 Oct 2024 11:15:20 -0700 Jeff Xu <jeffxu@chromium.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
next prev parent reply other threads:[~2024-10-17 23:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-16 20:17 [PATCH 0/2] mm/mremap: Remove extra vma tree walk Liam R. Howlett
2024-10-16 20:17 ` [PATCH 1/2] mm/mremap: Clean up vma_to_resize() Liam R. Howlett
2024-10-17 17:55 ` Jeff Xu
2024-10-17 18:07 ` Liam R. Howlett
2024-10-17 18:15 ` Jeff Xu
2024-10-17 21:08 ` Andrew Morton
2024-10-17 23:53 ` Liam R. Howlett [this message]
2024-10-18 0:00 ` Andrew Morton
2024-10-16 20:17 ` [PATCH 2/2] mm/mremap: Remove goto from mremap_to() Liam R. Howlett
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=hwz7y3jqi7ynxwtqzisrlo3zrdkdwlfb45nb4nixjcontpiry6@mdtki5al2no5 \
--to=liam.howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=jannh@google.com \
--cc=jeffxu@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=pedro.falcato@gmail.com \
--cc=wangkefeng.wang@huawei.com \
--cc=zhengqi.arch@bytedance.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox