[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190822075151.24838-2-atish.patra@wdc.com>
Date: Thu, 22 Aug 2019 00:51:49 -0700
From: Atish Patra <atish.patra@....com>
To: linux-kernel@...r.kernel.org
Cc: Atish Patra <atish.patra@....com>,
Albert Ou <aou@...s.berkeley.edu>,
linux-riscv@...ts.infradead.org,
Palmer Dabbelt <palmer@...ive.com>,
Paul Walmsley <paul.walmsley@...ive.com>,
Christoph Hellwig <hch@....de>, Anup Patel <Anup.Patel@....com>
Subject: [PATCH v4 1/3] RISC-V: Do not invoke SBI call if cpumask is empty
SBI calls are expensive. If cpumask is empty, there is no need to
trap via SBI as no remote tlb flushing is required.
Signed-off-by: Atish Patra <atish.patra@....com>
---
arch/riscv/mm/tlbflush.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/riscv/mm/tlbflush.c b/arch/riscv/mm/tlbflush.c
index df93b26f1b9d..1293b8017ee0 100644
--- a/arch/riscv/mm/tlbflush.c
+++ b/arch/riscv/mm/tlbflush.c
@@ -14,6 +14,9 @@ static void __sbi_tlb_flush_range(struct cpumask *cmask, unsigned long start,
{
struct cpumask hmask;
+ if (cpumask_empty(cmask))
+ return;
+
riscv_cpuid_to_hartid_mask(cmask, &hmask);
sbi_remote_sfence_vma(hmask.bits, start, size);
}
--
2.21.0
Powered by blists - more mailing lists