summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm
diff options
context:
space:
mode:
authorBalbir Singh <bsingharora@gmail.com>2017-05-25 17:28:32 +1000
committerMichael Ellerman <mpe@ellerman.id.au>2017-06-05 19:02:55 +1000
commitc5cee6421cd651446b93c231f0ab8ff2530ba25d (patch)
treeb9505e91b8da77edf6a5fe1b55a3d57915d4d684 /arch/powerpc/mm
parent64d09f5ecb237974bc824800e5e5012fd71801c7 (diff)
downloadlinux-c5cee6421cd651446b93c231f0ab8ff2530ba25d.tar.gz
linux-c5cee6421cd651446b93c231f0ab8ff2530ba25d.tar.bz2
linux-c5cee6421cd651446b93c231f0ab8ff2530ba25d.zip
powerpc/mm/hash: Do a local flush if possible when no batch is active
Currently in hpte_need_flush() if there is no batch pending we always do a global TLB flush, which is inefficient if the mm has never run on another thread. Instead do the same check that __flush_tlb_pending() does and check if a local flush is sufficient when batch->active is false. Instead of open-coding it we use mm_is_thread_local(). Signed-off-by: Balbir Singh <bsingharora@gmail.com> [mpe: Don't use a local, just inline mm_is_thread_local()] Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/mm')
-rw-r--r--arch/powerpc/mm/tlb_hash64.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/powerpc/mm/tlb_hash64.c b/arch/powerpc/mm/tlb_hash64.c
index 4517aa43a8b1..b5b0fb97b9c0 100644
--- a/arch/powerpc/mm/tlb_hash64.c
+++ b/arch/powerpc/mm/tlb_hash64.c
@@ -93,12 +93,10 @@ 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);
+ flush_hash_page(vpn, rpte, psize, ssize, mm_is_thread_local(mm));
put_cpu_var(ppc64_tlb_batch);
return;
}