The patch titled Subject: mm: use update_mmu_tlb_range() to simplify code has been added to the -mm mm-unstable branch. Its filename is mm-use-update_mmu_tlb_range-to-simplify-code.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-use-update_mmu_tlb_range-to-simplify-code.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: "Bang Li" <libang.li@xxxxxxxxxxxx> Subject: mm: use update_mmu_tlb_range() to simplify code Date: Wed, 22 May 2024 14:12:04 +0800 Let us simplify the code by update_mmu_tlb_range(). Link: https://lkml.kernel.org/r/20240522061204.117421-4-libang.li@xxxxxxxxxxxx Signed-off-by: Bang Li <libang.li@xxxxxxxxxxxx> Reviewed-by: Lance Yang <ioworker0@xxxxxxxxx> Acked-by: David Hildenbrand <david@xxxxxxxxxx> Cc: Chris Zankel <chris@xxxxxxxxxx> Cc: Huacai Chen <chenhuacai@xxxxxxxxxx> Cc: Max Filippov <jcmvbkbc@xxxxxxxxx> Cc: Palmer Dabbelt <palmer@xxxxxxxxxxx> Cc: Paul Walmsley <paul.walmsley@xxxxxxxxxx> Cc: Ryan Roberts <ryan.roberts@xxxxxxx> Cc: Thomas Bogendoerfer <tsbogend@xxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/memory.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) --- a/mm/memory.c~mm-use-update_mmu_tlb_range-to-simplify-code +++ a/mm/memory.c @@ -4463,7 +4463,6 @@ static vm_fault_t do_anonymous_page(stru vm_fault_t ret = 0; int nr_pages = 1; pte_t entry; - int i; /* File mapping without ->vm_ops ? */ if (vma->vm_flags & VM_SHARED) @@ -4533,8 +4532,7 @@ static vm_fault_t do_anonymous_page(stru update_mmu_tlb(vma, addr, vmf->pte); goto release; } else if (nr_pages > 1 && !pte_range_none(vmf->pte, nr_pages)) { - for (i = 0; i < nr_pages; i++) - update_mmu_tlb(vma, addr + PAGE_SIZE * i, vmf->pte + i); + update_mmu_tlb_range(vma, addr, vmf->pte, nr_pages); goto release; } _ Patches currently in -mm which might be from libang.li@xxxxxxxxxxxx are mm-add-update_mmu_tlb_range.patch mm-implement-update_mmu_tlb-using-update_mmu_tlb_range.patch mm-use-update_mmu_tlb_range-to-simplify-code.patch