[PATCH v7] arm64/mm: Optimize loop to reduce redundant operations of contpte_ptep_get

Andrew Morton akpm at linux-foundation.org
Tue Jun 24 14:15:53 PDT 2025


On Tue, 24 Jun 2025 23:25:49 +0800 Xavier Xia <xavier.qyxia at gmail.com> wrote:

> This commit optimizes the contpte_ptep_get and contpte_ptep_get_lockless
> function by adding early termination logic. It checks if the dirty and
> young bits of orig_pte are already set and skips redundant bit-setting
> operations during the loop. This reduces unnecessary iterations and
> improves performance.

Thanks, I added this to mm.git for some testing.  But perhaps the ARM
tree would be a better merge path - more testing, at least.



More information about the linux-arm-kernel mailing list