linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
To: Harry Yoo <harry.yoo@oracle.com>
Cc: Ye Liu <ye.liu@linux.dev>,
	akpm@linux-foundation.org, linmiaohe@huawei.com,
	nao.horiguchi@gmail.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, Ye Liu <liuye@kylinos.cn>,
	David Hildenbrand <david@redhat.com>,
	"Liam R. Howlett" <Liam.Howlett@oracle.com>,
	Vlastimil Babka <vbabka@suse.cz>, Rik van Riel <riel@surriel.com>
Subject: Re: [PATCH 1/3] mm/rmap: rename page__anon_vma to page_anon_vma for consistency
Date: Fri, 18 Apr 2025 10:42:23 +0100	[thread overview]
Message-ID: <a8dce603-013d-48b2-9d17-08c698dbfbcb@lucifer.local> (raw)
In-Reply-To: <aAIddlu9x5RTZT8k@harry>

On Fri, Apr 18, 2025 at 06:37:58PM +0900, Harry Yoo wrote:
> On Fri, Apr 18, 2025 at 10:14:25AM +0100, Lorenzo Stoakes wrote:
> > On Fri, Apr 18, 2025 at 03:52:24PM +0800, 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>
> >
> > Thanks, this looks good. I don't know why we named it this way :)
>
> At that time there was page_anon_vma() instead of folio_anon_vma()
> so the author couldn't name the variable page_anon_vma :)

Ahhh mystery__solved! Thanks Harry ;)

>
> --
> Cheers,
> Harry / Hyeonggon
>
> > Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
> >
> > > ---
> > >  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);
> > >  		/*
> > >  		 * Note: swapoff's unuse_vma() is more efficient with this
> > >  		 * check, and needs it to match anon_vma when KSM is active.
> > >  		 */
> > > -		if (!vma->anon_vma || !page__anon_vma ||
> > > -		    vma->anon_vma->root != page__anon_vma->root)
> > > +		if (!vma->anon_vma || !page_anon_vma ||
> > > +		    vma->anon_vma->root != page_anon_vma->root)
> > >  			return -EFAULT;
> > >  	} else if (!vma->vm_file) {
> > >  		return -EFAULT;
> > > @@ -803,7 +803,7 @@ unsigned long page_address_in_vma(const struct folio *folio,
> > >  		return -EFAULT;
> > >  	}
> > >
> > > -	/* KSM folios don't reach here because of the !page__anon_vma check */
> > > +	/* KSM folios don't reach here because of the !page_anon_vma check */
> > >  	return vma_address(vma, page_pgoff(folio, page), 1);
> > >  }
> > >
> > > --
> > > 2.25.1
> > >

  reply	other threads:[~2025-04-18  9:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-18  7:52 [PATCH 0/3] mm: minor cleanups in rmap and memory-failure Ye Liu
2025-04-18  7:52 ` [PATCH 1/3] mm/rmap: rename page__anon_vma to page_anon_vma for consistency Ye Liu
2025-04-18  9:14   ` Lorenzo Stoakes
2025-04-18  9:37     ` Harry Yoo
2025-04-18  9:42       ` Lorenzo Stoakes [this message]
2025-04-18  7:52 ` [PATCH 2/3] mm/rmap: fix typo in comment in page_address_in_vma Ye Liu
2025-04-18  9:14   ` Lorenzo Stoakes
2025-04-18  7:52 ` [PATCH 3/3] mm/memory-failure: inline add_to_kill_anon_file() logic at call sites Ye Liu
2025-04-18  9:18   ` Lorenzo Stoakes
2025-04-18  9:12 ` [PATCH 0/3] mm: minor cleanups in rmap and memory-failure 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=a8dce603-013d-48b2-9d17-08c698dbfbcb@lucifer.local \
    --to=lorenzo.stoakes@oracle.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --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=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;
as well as URLs for NNTP newsgroup(s).