Use set_softleaf_ptes() to store multiple uffd-wp marker entries instead of open coding the batched setting. Reviewed-by: Barry Song Signed-off-by: Dev Jain --- mm/memory.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index 60fd0a08b35f5..bed5cd90356f4 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -1700,14 +1700,8 @@ bool cond_install_uffd_wp_ptes(struct vm_area_struct *vma, if (likely(!arm_uffd_pte)) return false; - for (;;) { - set_pte_at(vma->vm_mm, addr, ptep, - make_pte_marker(PTE_MARKER_UFFD_WP)); - if (--nr_ptes == 0) - break; - ptep++; - addr += PAGE_SIZE; - } + set_softleaf_ptes(vma->vm_mm, addr, ptep, + make_pte_marker(PTE_MARKER_UFFD_WP), nr_ptes); return true; } -- 2.43.0