[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK1f24=Cm--tn4MsxBQEoBV048OsrGGyVVsy0B2MT1VMn+YoBg@mail.gmail.com>
Date: Mon, 20 May 2024 22:45:02 +0800
From: Lance Yang <ioworker0@...il.com>
To: Bang Li <libang.li@...group.com>
Cc: akpm@...ux-foundation.org, chenhuacai@...nel.org,
tsbogend@...ha.franken.de, paul.walmsley@...ive.com, palmer@...belt.com,
chris@...kel.net, jcmvbkbc@...il.com, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, loongarch@...ts.linux.dev,
linux-riscv@...ts.infradead.org, david@...hat.com, ryan.roberts@....com,
libang.linux@...il.com
Subject: Re: [PATCH v3 3/3] mm: Use update_mmu_tlb_range() to simplify code
On Sat, May 18, 2024 at 3:51 PM Bang Li <libang.li@...group.com> wrote:
>
> Let us simplify the code by update_mmu_tlb_range().
>
LGTM.
Reviewed-by: Lance Yang <ioworker0@...il.com>
> Signed-off-by: Bang Li <libang.li@...group.com>
> ---
> mm/memory.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/mm/memory.c b/mm/memory.c
> index eea6e4984eae..2d53e29cf76e 100644
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -4421,7 +4421,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)
> @@ -4491,8 +4490,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;
> }
>
> --
> 2.19.1.6.gb485710b
>
Powered by blists - more mailing lists