From: Christoph Hellwig <hch@infradead.org>
To: Yang Shi <yang@os.amperecomputing.com>
Cc: 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: Thu, 27 Jun 2024 23:35:04 -0700 [thread overview]
Message-ID: <Zn5ZmPQCdvHTCwAn@infradead.org> (raw)
In-Reply-To: <20240627221413.671680-1-yang@os.amperecomputing.com>
> +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?
> + 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)
next prev parent reply other threads:[~2024-06-28 6:35 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-27 22:14 [v2 PATCH] mm: gup: do not call try_grab_folio() in slow path 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 [this message]
2024-06-28 18:27 ` Yang Shi
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=Zn5ZmPQCdvHTCwAn@infradead.org \
--to=hch@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--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;
as well as URLs for NNTP newsgroup(s).