diff options
author | Atish Patra <atish.patra@wdc.com> | 2019-08-22 00:51:51 -0700 |
---|---|---|
committer | Paul Walmsley <paul.walmsley@sifive.com> | 2019-10-29 11:32:18 -0700 |
commit | 6efb16b1d5514865d0f7a01910648568ad3225d8 (patch) | |
tree | bcb234f37f6939f1ec1f3a59024e9e90e7235017 | |
parent | 31738ede9b339c90216b8fd10da0b1567a041f06 (diff) |
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 <atish.patra@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com>
-rw-r--r-- | arch/riscv/mm/tlbflush.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/riscv/mm/tlbflush.c b/arch/riscv/mm/tlbflush.c index 3531d4647323..720b443c4528 100644 --- a/arch/riscv/mm/tlbflush.c +++ b/arch/riscv/mm/tlbflush.c @@ -27,7 +27,10 @@ static void __sbi_tlb_flush_range(struct cpumask *cmask, unsigned long start, if (cpumask_any_but(cmask, cpuid) >= nr_cpu_ids) { /* local cpu is the only cpu present in cpumask */ - local_flush_tlb_all(); + if (size <= PAGE_SIZE) + local_flush_tlb_page(start); + else + local_flush_tlb_all(); } else { riscv_cpuid_to_hartid_mask(cmask, &hmask); sbi_remote_sfence_vma(cpumask_bits(&hmask), start, size); |