Skip to content

Commit 6efb16b

Browse files
atishp04paul-walmsley-sifive
authored andcommitted
RISC-V: Issue a tlb page flush if possible
If tlbflush request is for page only, there is no need to do a complete local tlb shootdown. Just do a local tlb flush for the given address. Signed-off-by: Atish Patra <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Paul Walmsley <[email protected]>
1 parent 31738ed commit 6efb16b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

arch/riscv/mm/tlbflush.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ static void __sbi_tlb_flush_range(struct cpumask *cmask, unsigned long start,
2727

2828
if (cpumask_any_but(cmask, cpuid) >= nr_cpu_ids) {
2929
/* local cpu is the only cpu present in cpumask */
30-
local_flush_tlb_all();
30+
if (size <= PAGE_SIZE)
31+
local_flush_tlb_page(start);
32+
else
33+
local_flush_tlb_all();
3134
} else {
3235
riscv_cpuid_to_hartid_mask(cmask, &hmask);
3336
sbi_remote_sfence_vma(cpumask_bits(&hmask), start, size);

0 commit comments

Comments
 (0)