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

From: Yeoreum Yun

Date: Tue Dec 01 2026 - 11:49:16 EST


On Tue, Dec 01, 2026 at 12:21:46PM +0100, David Hildenbrand (Arm) wrote:
> 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.

Thanks!

--
Sincerely,
Yeoreum Yun