Skip to content

Commit 6384423

Browse files
atishp04paul-walmsley-sifive
authored andcommitted
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 <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Paul Walmsley <[email protected]>
1 parent 00a5bf3 commit 6384423

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

arch/riscv/mm/tlbflush.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ static void __sbi_tlb_flush_range(struct cpumask *cmask, unsigned long start,
1414
{
1515
struct cpumask hmask;
1616

17+
if (cpumask_empty(cmask))
18+
return;
19+
1720
riscv_cpuid_to_hartid_mask(cmask, &hmask);
1821
sbi_remote_sfence_vma(hmask.bits, start, size);
1922
}

0 commit comments

Comments
 (0)