diff options
| author | Bang Li <[email protected]> | 2024-05-22 14:12:04 +0800 |
|---|---|---|
| committer | Andrew Morton <[email protected]> | 2024-07-03 19:29:57 -0700 |
| commit | 6faa49d1c4404e0b949fd92f1e891c24870d4f86 (patch) | |
| tree | 82c418fa0410fa977dbd3e70ab301ef1d1039eb6 | |
| parent | 8f65aa32239f1c3f11b7a25bd5921223bafc5fed (diff) | |
mm: use update_mmu_tlb_range() to simplify code
Let us simplify the code by update_mmu_tlb_range().
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Bang Li <[email protected]>
Reviewed-by: Lance Yang <[email protected]>
Acked-by: David Hildenbrand <[email protected]>
Cc: Chris Zankel <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: Max Filippov <[email protected]>
Cc: Palmer Dabbelt <[email protected]>
Cc: Paul Walmsley <[email protected]>
Cc: Ryan Roberts <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
| -rw-r--r-- | mm/memory.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/mm/memory.c b/mm/memory.c index d451b3125943..edf2004fcdf9 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -4457,7 +4457,6 @@ static vm_fault_t do_anonymous_page(struct vm_fault *vmf) 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) @@ -4527,8 +4526,7 @@ static vm_fault_t do_anonymous_page(struct vm_fault *vmf) 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; } |