Skip to content

Commit

Permalink
powerpc/mm/hash: Do a local flush if possible when no batch is active
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Balbir Singh authored and Michael Ellerman committed Jun 5, 2017
1 parent 64d09f5 commit c5cee64
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions arch/powerpc/mm/tlb_hash64.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit c5cee64

Please sign in to comment.