All of lore.kernel.org
 help / color / mirror / Atom feed
From: Samuel Holland <samuel.holland@sifive.com>
To: Alexandre Ghiti <alexghiti@rivosinc.com>
Cc: Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Jisheng Zhang <jszhang@kernel.org>,
	linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -fixes] riscv: Fix arch_tlbbatch_flush() by clearing the batch cpumask
Date: Wed, 7 Feb 2024 13:23:55 -0600	[thread overview]
Message-ID: <a21e4253-9ef6-4c44-917c-02742440d192@sifive.com> (raw)
In-Reply-To: <20240130115508.105386-1-alexghiti@rivosinc.com>

Hi Alex,

On 2024-01-30 5:55 AM, Alexandre Ghiti wrote:
> We must clear the cpumask once we have flushed the batch, otherwise cpus
> get accumulated and we end sending IPIs to more cpus than needed.
> 
> Fixes: 54d7431af73e ("riscv: Add support for BATCHED_UNMAP_TLB_FLUSH")
> Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
> ---
>  arch/riscv/mm/tlbflush.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/riscv/mm/tlbflush.c b/arch/riscv/mm/tlbflush.c
> index 99c3e037f127..c8efc3f87a0f 100644
> --- a/arch/riscv/mm/tlbflush.c
> +++ b/arch/riscv/mm/tlbflush.c
> @@ -240,4 +240,5 @@ void arch_tlbbatch_flush(struct arch_tlbflush_unmap_batch *batch)
>  {
>  	__flush_tlb_range(NULL, &batch->cpumask,
>  			  0, FLUSH_TLB_MAX_SIZE, PAGE_SIZE);
> +	cpumask_clear(&batch->cpumask);
>  }

This patch doesn't apply to fixes -- it looks like it was based on "riscv: Call
secondary mmu notifier when flushing the tlb"[1], which has not been merged and
would go in for-next anyway. Otherwise:

Reviewed-by: Samuel Holland <samuel.holland@sifive.com>

[1]: https://lore.kernel.org/all/20240124080325.2324462-1-alexghiti@rivosinc.com/


WARNING: multiple messages have this Message-ID (diff)
From: Samuel Holland <samuel.holland@sifive.com>
To: Alexandre Ghiti <alexghiti@rivosinc.com>
Cc: Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Jisheng Zhang <jszhang@kernel.org>,
	linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -fixes] riscv: Fix arch_tlbbatch_flush() by clearing the batch cpumask
Date: Wed, 7 Feb 2024 13:23:55 -0600	[thread overview]
Message-ID: <a21e4253-9ef6-4c44-917c-02742440d192@sifive.com> (raw)
In-Reply-To: <20240130115508.105386-1-alexghiti@rivosinc.com>

Hi Alex,

On 2024-01-30 5:55 AM, Alexandre Ghiti wrote:
> We must clear the cpumask once we have flushed the batch, otherwise cpus
> get accumulated and we end sending IPIs to more cpus than needed.
> 
> Fixes: 54d7431af73e ("riscv: Add support for BATCHED_UNMAP_TLB_FLUSH")
> Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
> ---
>  arch/riscv/mm/tlbflush.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/riscv/mm/tlbflush.c b/arch/riscv/mm/tlbflush.c
> index 99c3e037f127..c8efc3f87a0f 100644
> --- a/arch/riscv/mm/tlbflush.c
> +++ b/arch/riscv/mm/tlbflush.c
> @@ -240,4 +240,5 @@ void arch_tlbbatch_flush(struct arch_tlbflush_unmap_batch *batch)
>  {
>  	__flush_tlb_range(NULL, &batch->cpumask,
>  			  0, FLUSH_TLB_MAX_SIZE, PAGE_SIZE);
> +	cpumask_clear(&batch->cpumask);
>  }

This patch doesn't apply to fixes -- it looks like it was based on "riscv: Call
secondary mmu notifier when flushing the tlb"[1], which has not been merged and
would go in for-next anyway. Otherwise:

Reviewed-by: Samuel Holland <samuel.holland@sifive.com>

[1]: https://lore.kernel.org/all/20240124080325.2324462-1-alexghiti@rivosinc.com/


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  parent reply	other threads:[~2024-02-07 19:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-30 11:55 [PATCH -fixes] riscv: Fix arch_tlbbatch_flush() by clearing the batch cpumask Alexandre Ghiti
2024-01-30 11:55 ` Alexandre Ghiti
2024-02-06  0:26 ` Charlie Jenkins
2024-02-06  0:26   ` Charlie Jenkins
2024-02-06 10:15   ` Jisheng Zhang
2024-02-06 10:15     ` Jisheng Zhang
2024-02-07 19:23 ` Samuel Holland [this message]
2024-02-07 19:23   ` Samuel Holland
2024-02-07 19:35   ` Palmer Dabbelt
2024-02-07 19:35     ` Palmer Dabbelt
2024-02-08  1:30 ` patchwork-bot+linux-riscv
2024-02-08  1:30   ` patchwork-bot+linux-riscv

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=a21e4253-9ef6-4c44-917c-02742440d192@sifive.com \
    --to=samuel.holland@sifive.com \
    --cc=alexghiti@rivosinc.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=jszhang@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.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.