From 7b7690ed9c0e5990a8cda2511f4c438c9ad8c9dc Mon Sep 17 00:00:00 2001 From: Atish Patra Date: Thu, 29 Aug 2019 15:19:13 -0700 Subject: [PATCH] lib: Upgrade to full flush if size is at least threshold Currently, we upgrade to a full tlb flush only If a tlb flush request size is greater than the threshold. This is done as sfence in RISC-V can only flush 4KB at a time. Doing a large number of flushes page by page impacts the performance. It is better to do a full tlbflush if the request size is at least equal to the threshold size. Signed-off-by: Atish Patra Reviewed-by: Anup Patel --- lib/sbi/sbi_tlb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sbi/sbi_tlb.c b/lib/sbi/sbi_tlb.c index e4f6fe2..c4e5f48 100644 --- a/lib/sbi/sbi_tlb.c +++ b/lib/sbi/sbi_tlb.c @@ -232,7 +232,7 @@ int sbi_tlb_fifo_update(struct sbi_scratch *rscratch, u32 hartid, void *data) * upgrade it to flush all because we can only flush * 4KB at a time. */ - if (tinfo->size >= SBI_TLB_FLUSH_MAX_SIZE) { + if (tinfo->size > SBI_TLB_FLUSH_MAX_SIZE) { tinfo->start = 0; tinfo->size = SBI_TLB_FLUSH_ALL; }