linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Yang Shi <shy828301@gmail.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Yang Shi <yang@os.amperecomputing.com>,
	peterx@redhat.com, yangge1116@126.com,  david@redhat.com,
	akpm@linux-foundation.org, linux-mm@kvack.org,
	 linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [v2 PATCH] mm: gup: do not call try_grab_folio() in slow path
Date: Fri, 28 Jun 2024 11:27:15 -0700	[thread overview]
Message-ID: <CAHbLzkodRFsBWvZ8zZZVeFTNzrwV0PNpT2XmUwFxL1KygPmd4Q@mail.gmail.com> (raw)
In-Reply-To: <Zn5ZmPQCdvHTCwAn@infradead.org>

On Thu, Jun 27, 2024 at 11:35 PM Christoph Hellwig <hch@infradead.org> wrote:
>
> > +int __must_check try_grab_folio(struct folio *folio, int refs, unsigned int flags)
>
> Overly long line (same for the external declaration)
>
> > +     struct page *page = &folio->page;
>
> Page is only used for is_pci_p2pdma_page and is_zero_page, and for
> the latter a is_zero_folio already exist.  Maybe remove the local
> variable, use is_zero_folio and just open code the dereference in the
> is_pci_p2pdma_page call?

Thanks, Christoph. Good point, I think we can use is_zero_folio and
open coeded it in is_pci_p2pdma_page.

And all the format problems will be solved in v3.

>
> > +             ret = gup_hugepte(vma, ptep, sz, addr, end, flags, pages, nr, fast);
>
> Overly lone line.
>
> > +             folio_ref_add(folio,
> > +                             refs * (GUP_PIN_COUNTING_BIAS - 1));
>
> Nit: this easily fits onto a single line.
>
> >                       if (gup_hugepd(NULL, __hugepd(pmd_val(pmd)), addr,
> > -                                    PMD_SHIFT, next, flags, pages, nr) != 1)
> > +                                    PMD_SHIFT, next, flags, pages, nr, true) != 1)
>
> Overly long lin (same in the similar calls below)
>
>


      reply	other threads:[~2024-06-28 18:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-27 22:14 Yang Shi
2024-06-27 22:54 ` Andrew Morton
2024-06-27 23:02   ` Yang Shi
2024-06-27 23:19 ` Peter Xu
2024-06-27 23:32   ` Andrew Morton
2024-06-27 23:39     ` Yang Shi
2024-06-27 23:43     ` Peter Xu
2024-06-28  1:25       ` Ge Yang
2024-06-28  6:09       ` Ge Yang
2024-06-28  6:35 ` Christoph Hellwig
2024-06-28 18:27   ` Yang Shi [this message]

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=CAHbLzkodRFsBWvZ8zZZVeFTNzrwV0PNpT2XmUwFxL1KygPmd4Q@mail.gmail.com \
    --to=shy828301@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=peterx@redhat.com \
    --cc=stable@vger.kernel.org \
    --cc=yang@os.amperecomputing.com \
    --cc=yangge1116@126.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