Re: [PATCH v3 01/20] mm/pgtable: define (pgd|p4d|pud)_offset_lockless() for folded page tables

From: David Hildenbrand (Arm)

Date: Tue Dec 01 2026 - 06:22:19 EST


On 11/30/26 18:18, Yeoreum Yun wrote:
> From: "David Hildenbrand (Arm)" <david@xxxxxxxxxx>

We should adjust the title to


mm/pgtable: define (p4d|pud|pmd)_offset_lockless() for folded page tables

>
> The default helpers fallback to pud_offset(), passing a pointer to the
> stack value.
>
> Let's provide variants that do exactly what (pgd|p4d|pud)_offset() do,
> but ignore the passed pgd_t/p4d_t/pud_t, consequently not working on a
> pointer to the stack value like the default handlers would.
>
> With this patch, Drop the arm64 custom variant that did that. As it documents:

s/Drop/drop/

>
> Note: reusing the original pointer means that it may be
> dereferenced the same (live) page-table entry multiple times.
> This is safe because it is still only loaded once in the
> context of each level and the CPU guarantees same-address
> read-after-read ordering.

That's not the actual comment we had in there ;)


All things I can fix up.

--
Cheers,

David