Re: [PATCH v3 6/6] arm64: mm: implement the architecture-specific test_and_clear_young_ptes()
From: David Hildenbrand (Arm)
Date: Mon Mar 09 2026 - 10:41:57 EST
>>
>> (b) The first pte is !pte_cont(), but some others in there are?
>
> IMO they can’t be handled in a single batch. Since the folio_pte_batch()
> will group consecutive !cont PTEs into one batch and consecutive cont
> PTEs into another (assume all PTEs belong to a single large folio),
> because their PTE entries have different CONT bits.
Interesting, thanks. I thought that folio_pte_batch() would be able to
batch that.
But yes, pte_batch_hint() relies on the CONT bit still being set after a
ptep_get(). I wonder whether we should document somewhere that the arm
implementation depends on that.
This might be something to look into in the future. (make
folio_pte_batch() ignore cont information when comparing and make the
arm implementation be able to deal with that).
Assume we unmapped the last page of a large folio. Ideally, we'd be able
to process the remaining THP pieces (all ptes) in a single operation. I
guess right now it would be two.
--
Cheers,
David