[PATCH v2] powerpc/mm: convert tlbie to tlbiel when no batch is active

Subsystems: linux for powerpc (32-bit and 64-bit), the rest

STALE3354d

2 messages, 2 authors, 2017-06-08 · open the first message on its own page

[PATCH v2] powerpc/mm: convert tlbie to tlbiel when no batch is active

From: Balbir Singh <bsingharora@gmail.com>
Date: 2017-05-25 07:28:46

Do the checks that __flush_tlb_pending() does and check if
a local flush will do when batch->active is false inside of
hpte_need_flush(). I've checked the changes with tlbie tracing,
I see local flushes as applicable now and I've also run
some basic ltp testcases on top of these changes on a powernv
machine.

Signed-off-by: Balbir Singh <bsingharora@gmail.com>
---
 arch/powerpc/mm/tlb_hash64.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/mm/tlb_hash64.c b/arch/powerpc/mm/tlb_hash64.c
index 4517aa4..b655c3b 100644
--- a/arch/powerpc/mm/tlb_hash64.c
+++ b/arch/powerpc/mm/tlb_hash64.c
@@ -93,12 +93,13 @@ void hpte_need_flush(struct mm_struct *mm, unsigned long addr,
 
 	/*
 	 * Check if we have an active batch on this CPU. If not, just
-	 * flush now and return. For now, we don global invalidates
-	 * in that case, might be worth testing the mm cpu mask though
-	 * and decide to use local invalidates instead...
+	 * flush now and return.
 	 */
 	if (!batch->active) {
-		flush_hash_page(vpn, rpte, psize, ssize, 0);
+		int local = 0;
+		if (mm_is_thread_local(mm))
+			local = 1;
+		flush_hash_page(vpn, rpte, psize, ssize, local);
 		put_cpu_var(ppc64_tlb_batch);
 		return;
 	}
-- 
2.9.3

Re: [v2] powerpc/mm: convert tlbie to tlbiel when no batch is active

From: Michael Ellerman <hidden>
Date: 2017-06-08 04:07:37

On Thu, 2017-05-25 at 07:28:32 UTC, Balbir Singh wrote:
Do the checks that __flush_tlb_pending() does and check if
a local flush will do when batch->active is false inside of
hpte_need_flush(). I've checked the changes with tlbie tracing,
I see local flushes as applicable now and I've also run
some basic ltp testcases on top of these changes on a powernv
machine.

Signed-off-by: Balbir Singh <bsingharora@gmail.com>
Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/c5cee6421cd651446b93c231f0ab8f

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help