linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Ye Liu <ye.liu@linux.dev>,
	akpm@linux-foundation.org, nao.horiguchi@gmail.com,
	linmiaohe@huawei.com, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, Liam.Howlett@oracle.com,
	harry.yoo@oracle.com, riel@surriel.com, vbabka@suse.cz,
	liuye@kylinos.cn
Subject: Re: [PATCH v2 1/2] mm/rmap: rename page__anon_vma to page_anon_vma for consistency
Date: Fri, 18 Apr 2025 12:58:15 +0200	[thread overview]
Message-ID: <fd5e2424-5084-4bde-bf97-767cdc3dda13@redhat.com> (raw)
In-Reply-To: <752651d1-7cca-45b8-b5ac-9c32ab97e9fd@lucifer.local>

On 18.04.25 12:50, Lorenzo Stoakes wrote:
> On Fri, Apr 18, 2025 at 12:40:10PM +0200, David Hildenbrand wrote:
>> On 18.04.25 11:55, Ye Liu wrote:
>>> From: Ye Liu <liuye@kylinos.cn>
>>>
>>> Renamed local variable page__anon_vma in page_address_in_vma() to
>>> page_anon_vma. The previous naming convention of using double underscores
>>> (__) is unnecessary and inconsistent with typical kernel style, which uses
>>> single underscores to denote local variables. Also updated comments to
>>> reflect the new variable name.
>>>
>>> Functionality unchanged.
>>>
>>> Signed-off-by: Ye Liu <liuye@kylinos.cn>
>>> ---
>>>    mm/rmap.c | 8 ++++----
>>>    1 file changed, 4 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/mm/rmap.c b/mm/rmap.c
>>> index 67bb273dfb80..b509c226e50d 100644
>>> --- a/mm/rmap.c
>>> +++ b/mm/rmap.c
>>> @@ -789,13 +789,13 @@ unsigned long page_address_in_vma(const struct folio *folio,
>>>    		const struct page *page, const struct vm_area_struct *vma)
>>>    {
>>>    	if (folio_test_anon(folio)) {
>>> -		struct anon_vma *page__anon_vma = folio_anon_vma(folio);
>>> +		struct anon_vma *page_anon_vma = folio_anon_vma(folio);
>>
>> I'm extremely confused why this should not simply be called "anon_vma". Why
>> do we need the "page" in here *at all* ?
> 
> Presumably to differentiate from the VMA's anon_vma, but it seems redundant
> and silly to preface it as the page's (really, folio's) anon_vma.

Exactly, thus my confusion :)

> 
> The original patch is strictly an improvement so I'm fine with that, but we
> could also rename this to anon_vma to make the function a little simpler to
> read.
> 
> I guess the key bit where this becomes vaguely relevant is:
> 
> 		    vma->anon_vma->root != page_anon_vma->root
> 
> This whole thing seems to be to deal with races with unuse_vma() as per the
> comment.
> 
> Anyway, TL;DR: fine with that rename if we want it!

Okay, let's drop the "page_" part if possible.

-- 
Cheers,

David / dhildenb



  reply	other threads:[~2025-04-18 10:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-18  9:55 [PATCH v2 0/2] mm: minor cleanups in rmap Ye Liu
2025-04-18  9:55 ` [PATCH v2 1/2] mm/rmap: rename page__anon_vma to page_anon_vma for consistency Ye Liu
2025-04-18 10:00   ` Lorenzo Stoakes
2025-04-18 10:12     ` Ye Liu
2025-04-18 10:40   ` David Hildenbrand
2025-04-18 10:50     ` Lorenzo Stoakes
2025-04-18 10:58       ` David Hildenbrand [this message]
2025-04-18  9:56 ` [PATCH v2 2/2] mm/rmap: fix typo in comment in page_address_in_vma Ye Liu
2025-04-18 10:00   ` Lorenzo Stoakes

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=fd5e2424-5084-4bde-bf97-767cdc3dda13@redhat.com \
    --to=david@redhat.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=harry.yoo@oracle.com \
    --cc=linmiaohe@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=liuye@kylinos.cn \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=nao.horiguchi@gmail.com \
    --cc=riel@surriel.com \
    --cc=vbabka@suse.cz \
    --cc=ye.liu@linux.dev \
    /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