From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Alexander Gordeev <agordeev@linux.ibm.com>,
Kevin Brodsky <kevin.brodsky@arm.com>,
Ryan Roberts <ryan.roberts@arm.com>,
Andrew Morton <akpm@linux-foundation.org>
Cc: linux-s390@vger.kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org,
Gerald Schaefer <gerald.schaefer@linux.ibm.com>,
Heiko Carstens <hca@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>
Subject: Re: [RFC PATCH 1/2] mm/gup: add missing pXdp_get() conversions
Date: Mon, 20 Apr 2026 21:28:59 +0200 [thread overview]
Message-ID: <2809fac6-44ef-426a-923d-01661e2f428c@kernel.org> (raw)
In-Reply-To: <3d0213714273d83c07cb7681119b799ca77984b9.1776684344.git.agordeev@linux.ibm.com>
On 4/20/26 14:13, Alexander Gordeev wrote:
> PMD and PUD entries revalidation has the same semantics as
> PTE entry revalidation. Convert the remaining direct entry
> dereferences to the corresponding pXdp_get() accessors.
>
> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
> ---
> mm/gup.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/mm/gup.c b/mm/gup.c
> index 8e7dc2c6ee73..d149a4b0df71 100644
> --- a/mm/gup.c
> +++ b/mm/gup.c
> @@ -2865,7 +2865,7 @@ static int gup_fast_pte_range(pmd_t pmd, pmd_t *pmdp, unsigned long addr,
> if (!folio)
> goto pte_unmap;
>
> - if (unlikely(pmd_val(pmd) != pmd_val(*pmdp)) ||
> + if (unlikely(pmd_val(pmd) != pmd_val(pmdp_get(pmdp))) ||
> unlikely(pte_val(pte) != pte_val(ptep_get(ptep)))) {
> gup_put_folio(folio, 1, flags);
> goto pte_unmap;
> @@ -2942,7 +2942,7 @@ static int gup_fast_pmd_leaf(pmd_t orig, pmd_t *pmdp, unsigned long addr,
> if (!folio)
> return 0;
>
> - if (unlikely(pmd_val(orig) != pmd_val(*pmdp))) {
> + if (unlikely(pmd_val(orig) != pmd_val(pmdp_get(pmdp)))) {
> gup_put_folio(folio, refs, flags);
> return 0;
> }
> @@ -2985,7 +2985,7 @@ static int gup_fast_pud_leaf(pud_t orig, pud_t *pudp, unsigned long addr,
> if (!folio)
> return 0;
>
> - if (unlikely(pud_val(orig) != pud_val(*pudp))) {
> + if (unlikely(pud_val(orig) != pud_val(pudp_get(pudp)))) {
> gup_put_folio(folio, refs, flags);
> return 0;
> }
These are all on lockless code paths. Shouldn't we be using the lockless
pte/pmd variants?
(not a matter of correctness, rather a matter of semantics)
--
Cheers,
David
next prev parent reply other threads:[~2026-04-20 19:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-20 12:13 [RFC PATCH 0/2] mm/gup: pgtable entry acccessors cleanup Alexander Gordeev
2026-04-20 12:13 ` [RFC PATCH 1/2] mm/gup: add missing pXdp_get() conversions Alexander Gordeev
2026-04-20 19:28 ` David Hildenbrand (Arm) [this message]
2026-04-20 12:13 ` [RFC PATCH 2/2] mm/gup: add lockless access semantics on entries validation Alexander Gordeev
2026-04-20 19:29 ` David Hildenbrand (Arm)
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=2809fac6-44ef-426a-923d-01661e2f428c@kernel.org \
--to=david@kernel.org \
--cc=agordeev@linux.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=gerald.schaefer@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=kevin.brodsky@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-s390@vger.kernel.org \
--cc=ryan.roberts@arm.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