From: Guo Ren <guoren@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Palmer Dabbelt <palmerdabbelt@google.com>,
Anup Patel <anup.patel@wdc.com>,
linux-riscv <linux-riscv@lists.infradead.org>
Subject: Re: [PATCH 1/2] riscv: pass the mm_struct to __sbi_tlb_flush_range
Date: Mon, 7 Jun 2021 00:43:28 +0800 [thread overview]
Message-ID: <CAJF2gTRmqVLJY+Ubc5g67mzXmfKoUO0oJpejK+pgTgDFupGSrQ@mail.gmail.com> (raw)
In-Reply-To: <20210606152050.636038-2-hch@lst.de>
Rebase with "THP supprt for RISCV" & "Add DMA_COHERENT v2" on linux-5.13-rc4.
Tested-by: Guo Ren <guoren@kernel.org>
On Sun, Jun 6, 2021 at 11:21 PM Christoph Hellwig <hch@lst.de> wrote:
>
> Move the call mm_cpumask from the callers into __sbi_tlb_flush_range to
> reduce a bit of duplicate code and prepare for future changes.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> arch/riscv/mm/tlbflush.c | 15 ++++++---------
> 1 file changed, 6 insertions(+), 9 deletions(-)
>
> diff --git a/arch/riscv/mm/tlbflush.c b/arch/riscv/mm/tlbflush.c
> index fea45af91f53..b458949fa8df 100644
> --- a/arch/riscv/mm/tlbflush.c
> +++ b/arch/riscv/mm/tlbflush.c
> @@ -10,13 +10,10 @@ void flush_tlb_all(void)
> sbi_remote_sfence_vma(NULL, 0, -1);
> }
>
> -/*
> - * This function must not be called with cmask being null.
> - * Kernel may panic if cmask is NULL.
> - */
> -static void __sbi_tlb_flush_range(struct cpumask *cmask, unsigned long start,
> +static void __sbi_tlb_flush_range(struct mm_struct *mm, unsigned long start,
> unsigned long size, unsigned long stride)
> {
> + struct cpumask *cmask = mm_cpumask(mm);
> struct cpumask hmask;
> unsigned int cpuid;
>
> @@ -41,23 +38,23 @@ static void __sbi_tlb_flush_range(struct cpumask *cmask, unsigned long start,
>
> void flush_tlb_mm(struct mm_struct *mm)
> {
> - __sbi_tlb_flush_range(mm_cpumask(mm), 0, -1, PAGE_SIZE);
> + __sbi_tlb_flush_range(mm, 0, -1, PAGE_SIZE);
> }
>
> void flush_tlb_page(struct vm_area_struct *vma, unsigned long addr)
> {
> - __sbi_tlb_flush_range(mm_cpumask(vma->vm_mm), addr, PAGE_SIZE, PAGE_SIZE);
> + __sbi_tlb_flush_range(vma->vm_mm, addr, PAGE_SIZE, PAGE_SIZE);
> }
>
> void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
> unsigned long end)
> {
> - __sbi_tlb_flush_range(mm_cpumask(vma->vm_mm), start, end - start, PAGE_SIZE);
> + __sbi_tlb_flush_range(vma->vm_mm, start, end - start, PAGE_SIZE);
> }
> #ifdef CONFIG_TRANSPARENT_HUGEPAGE
> void flush_pmd_tlb_range(struct vm_area_struct *vma, unsigned long start,
> unsigned long end)
> {
> - __sbi_tlb_flush_range(mm_cpumask(vma->vm_mm), start, end - start, PMD_SIZE);
> + __sbi_tlb_flush_range(vma->vm_mm, start, end - start, PMD_SIZE);
> }
> #endif
> --
> 2.30.2
>
--
Best Regards
Guo Ren
ML: https://lore.kernel.org/linux-csky/
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2021-06-06 16:44 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-06 15:20 rebased ASID-based tlbflush Christoph Hellwig
2021-06-06 15:20 ` [PATCH 1/2] riscv: pass the mm_struct to __sbi_tlb_flush_range Christoph Hellwig
2021-06-06 16:43 ` Guo Ren [this message]
2021-06-06 15:20 ` [PATCH 2/2] riscv: add ASID-based tlbflushing methods Christoph Hellwig
2021-06-06 16:49 ` Guo Ren
2021-06-13 0:47 ` rebased ASID-based tlbflush Palmer Dabbelt
2021-06-13 13:08 ` Guo Ren
2021-06-15 11:20 ` Liu Shixin
2021-06-15 15:10 ` Palmer Dabbelt
2021-06-15 15:22 ` Guo Ren
2021-06-16 2:38 ` [PATCH -next 1/2] mm/pgtable: add stubs for {pmd/pub}_{set/clear}_huge Liu Shixin
2021-06-16 2:38 ` [PATCH -next 2/2] riscv: Enable HAVE_ARCH_HUGE_VMAP for 64BIT Liu Shixin
2021-06-13 9:31 ` rebased ASID-based tlbflush Guo Ren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAJF2gTRmqVLJY+Ubc5g67mzXmfKoUO0oJpejK+pgTgDFupGSrQ@mail.gmail.com \
--to=guoren@kernel.org \
--cc=anup.patel@wdc.com \
--cc=hch@lst.de \
--cc=linux-riscv@lists.infradead.org \
--cc=palmerdabbelt@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.