[PATCH 4/5] mm: support batched checking of the young flag for MGLRU
Baolin Wang
baolin.wang at linux.alibaba.com
Thu Feb 26 01:27:17 PST 2026
On 2/26/26 5:08 PM, David Hildenbrand (Arm) wrote:
>
>>>
>>>> + pte_t pteval = ptep_get(pvmw.pte);
>>>
>>> I wonder if there could be a way to avoid this ptep_get() by letting
>>> page_vma_mapped_walk() just provide the last value it used (in
>>> check_pte() I guess). Something for another patch.
>>
>> Well, we’d need to add a new field to ‘struct page_vma_mapped_walk’ to
>> store the last value (e.g., pvmw.pteval),
>
> Yes.
>
>> but this makes me wonder if it
>> is worth adding a new field just to avoid a lightweight read (which
>> should have no obvious performance impact).
>
> You recall that ptep_get() on arm64 is not that lightweight due to
> con-pte? :)
>
> But yeah, something for another day.
OK.
>>> What is "batched"? Did you mean "nr_ptes" ? Or just the initial value
>>> for "nr" ?
>>
>> There is already an 'nr' variable in this function. "nr_ptes" sounds
>> good to me, and will use it.
>
> You can just use "nr" here and reuse it for the existing variable?
>
> Both have the same semantics (nr of ptes / pages), so having a single
> value might cause less confusion.
Sure. Will do.
More information about the linux-arm-kernel
mailing list