Re: [RFC V1 08/16] arm64/mm: Convert READ_ONCE() as pgdp_get() while accessing PGD

David Hildenbrand (Arm)
2026-04-15T10:37:46Z

On 4/10/26 07:30, Anshuman Khandual wrote:
> On 08/04/26 5:49 PM, David Hildenbrand (Arm) wrote:
>> On 2/24/26 06:11, Anshuman Khandual wrote:
>>> Convert all READ_ONCE() based PGD accesses as pgdp_get() instead which will
>>> support both D64 and D128 translation regime going forward.
>>
>> Please mention here why you move p4d_offset_phys/p4d_offset. (same
>> applies to other patches)
>
> Will do that.
>
>>
>> Do we get additional function calls that might degrade some page table
>> walkers?
>
> Sorry did not get it. Are you asking if D128 adds new page table
> function paths thus increasing memory access latency etc ?
Each p4d_offset() etc. now does a function call.

So during ordinary generic page table walking code (see
folio_walk_start() as one example), you'd now perform a bunch more
expensive function calls:

pgdp = pgd_offset(vma->vm_mm, addr);
...
p4dp = p4d_offset(pgdp, addr);
...
pudp = pud_offset(p4dp, addr);
...

That's not desirable. So I wonder if there is a way to just keep these
things inline.

Might have to move the definitions of pgdp_get() etc.

--
Cheers,

David