lkml.org 
[lkml]   [2019]   [Aug]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v3 2/3] RISC-V: Issue a tlb page flush if possible
Date
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>
---
arch/riscv/mm/tlbflush.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/riscv/mm/tlbflush.c b/arch/riscv/mm/tlbflush.c
index 36430ee3bed9..9f58b3790baa 100644
--- a/arch/riscv/mm/tlbflush.c
+++ b/arch/riscv/mm/tlbflush.c
@@ -22,7 +22,10 @@ static void __sbi_tlb_flush_range(struct cpumask *cmask, unsigned long start,
}

if (cpumask_test_cpu(cpuid, cmask) && cpumask_weight(cmask) == 1) {
- local_flush_tlb_all();
+ if (size <= PAGE_SIZE && size != -1)
+ local_flush_tlb_page(start);
+ else
+ local_flush_tlb_all();
goto done;
}
riscv_cpuid_to_hartid_mask(cmask, &hmask);
--
2.21.0
\
 
 \ /
  Last update: 2019-08-22 02:47    [W:0.085 / U:6.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site