linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Lance Yang <ioworker0@gmail.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: akpm@linux-foundation.org, ryan.roberts@arm.com,
	david@redhat.com,  21cnbao@gmail.com,
	baolin.wang@linux.alibaba.com, ziy@nvidia.com,
	 fengwei.yin@intel.com, ying.huang@intel.com,
	libang.li@antgroup.com,  linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] mm/mlock: implement folio_mlock_step() using folio_pte_batch()
Date: Mon, 3 Jun 2024 12:13:25 +0800	[thread overview]
Message-ID: <CAK1f24mj_LFEU8mP=vGhJMWLAq1JANWqtipPwMLvYh6nrp65Dg@mail.gmail.com> (raw)
In-Reply-To: <Zl06P-qdpca2V9aJ@casper.infradead.org>

Hi Matthew,

Thanks for taking time to review!

On Mon, Jun 3, 2024 at 11:36 AM Matthew Wilcox <willy@infradead.org> wrote:
>
> On Mon, Jun 03, 2024 at 11:31:17AM +0800, Lance Yang wrote:
> >  {
> > -     unsigned int count, i, nr = folio_nr_pages(folio);
> > -     unsigned long pfn = folio_pfn(folio);
> > -     pte_t ptent = ptep_get(pte);
>
> Please don't move type declarations later in the function.  Just because
> you can doesn't mean you should.

Thanks for pointing this out, I'll adjust as you suggested.

>
> > -     if (!folio_test_large(folio))
> > +     if (likely(!folio_test_large(folio)))
> >               return 1;
>
> How likely is this now?  How likely will it be in two years time?
> Does this actually make any difference in either code generation or
> performance?

IMO, this hint could impact code generation and performance :)
But it seems that 'likely' is not necessary here. I'll remove it.

Thanks again for your time!
Lance

>


  reply	other threads:[~2024-06-03  4:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-03  3:31 Lance Yang
2024-06-03  3:36 ` Matthew Wilcox
2024-06-03  4:13   ` Lance Yang [this message]
2024-06-03  4:14 ` Barry Song
2024-06-03  4:27   ` Lance Yang
2024-06-03  8:58   ` Baolin Wang
2024-06-03  9:03     ` David Hildenbrand

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='CAK1f24mj_LFEU8mP=vGhJMWLAq1JANWqtipPwMLvYh6nrp65Dg@mail.gmail.com' \
    --to=ioworker0@gmail.com \
    --cc=21cnbao@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=david@redhat.com \
    --cc=fengwei.yin@intel.com \
    --cc=libang.li@antgroup.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ryan.roberts@arm.com \
    --cc=willy@infradead.org \
    --cc=ying.huang@intel.com \
    --cc=ziy@nvidia.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