From: Wei Yang <richard.weiyang@gmail.com>
To: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
David Hildenbrand <david@redhat.com>,
Lorenzo Stoakes <ljs@kernel.org>,
Anshuman Khandual <anshuman.khandual@arm.com>,
Oscar Salvador <osalvador@suse.de>,
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: [PATCH v2] mm/page_vma_mapped_walk: Use ptep_get_lockless() for lockless access
Date: Thu, 7 May 2026 09:34:33 +0000 [thread overview]
Message-ID: <20260507093433.q5xybwumryxclnqy@master> (raw)
In-Reply-To: <20260504130434.2285053-1-agordeev@linux.ibm.com>
On Mon, May 04, 2026 at 03:04:34PM +0200, Alexander Gordeev wrote:
>Switch from ptep_get() to ptep_get_lockless() accessor for
>PTE reads when no lock is taken.
>
>Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
>---
> mm/page_vma_mapped.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/mm/page_vma_mapped.c b/mm/page_vma_mapped.c
>index a4d52fdb3056..6559e17f11c2 100644
>--- a/mm/page_vma_mapped.c
>+++ b/mm/page_vma_mapped.c
>@@ -41,7 +41,7 @@ static bool map_pte(struct page_vma_mapped_walk *pvmw, pmd_t *pmdvalp,
> if (!pvmw->pte)
> return false;
>
>- ptent = ptep_get(pvmw->pte);
>+ ptent = ptep_get_lockless(pvmw->pte);
>
> if (pte_none(ptent)) {
> return false;
>@@ -310,7 +310,7 @@ bool page_vma_mapped_walk(struct page_vma_mapped_walk *pvmw)
> goto restart;
> }
> pvmw->pte++;
>- } while (pte_none(ptep_get(pvmw->pte)));
>+ } while (pte_none(ptep_get_lockless(pvmw->pte)));
As Oscar mentioned in lkml.org/lkml/2026/4/27/630, map_pte() may take the
lock. So probably it is not right?
>
> if (!pvmw->ptl) {
> spin_lock(ptl);
>--
>2.51.0
>
--
Wei Yang
Help you, Help me
next prev parent reply other threads:[~2026-05-07 9:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-04 13:04 [PATCH v2] mm/page_vma_mapped_walk: Use ptep_get_lockless() for lockless access Alexander Gordeev
2026-05-07 9:34 ` Wei Yang [this message]
2026-05-07 10:32 ` Alexander Gordeev
2026-05-08 1:00 ` Wei Yang
2026-05-08 5:15 ` Alexander Gordeev
2026-05-08 6:23 ` Wei Yang
2026-05-08 8:17 ` David Hildenbrand (Arm)
2026-05-08 8:34 ` Alexander Gordeev
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=20260507093433.q5xybwumryxclnqy@master \
--to=richard.weiyang@gmail.com \
--cc=agordeev@linux.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=anshuman.khandual@arm.com \
--cc=david@redhat.com \
--cc=gerald.schaefer@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-s390@vger.kernel.org \
--cc=ljs@kernel.org \
--cc=osalvador@suse.de \
/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