Re: [PATCH] mm/page_vma_mapped_walk: add missing pgtable entry accessors

David Hildenbrand (Arm)
2026-05-04T12:43:03Z

On 5/3/26 08:51, Alexander Gordeev wrote:
> On Fri, May 01, 2026 at 09:01:09PM +0200, David Hildenbrand (Arm) wrote:
>> On 4/29/26 15:47, Alexander Gordeev wrote:
>>>
>>> (*)
>>>
>>>
>>> Ok, that is a different topic. I actually tried to resolve the lockless
>>> issue(s) in (*) while the direct dereferences just seemed to be relevant
>>> to go along (similarly to the GUP patch).
>>>
>>> But I would rather resend ptep_get() => ptep_get_lockless() fixes for
>>> this patch.
>>>
>>> Would it work?
>>
>> You mean only sending {*) ?
>
> Only this:
>
> 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)));
>

Makes sense!

--
Cheers,

David