]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
powerpc/mm/nohash: do not flush the entire mm when range is a single page
authorChristophe Leroy <christophe.leroy@c-s.fr>
Tue, 23 Jan 2018 13:22:50 +0000 (14:22 +0100)
committerMichael Ellerman <mpe@ellerman.id.au>
Sat, 27 Jan 2018 09:24:44 +0000 (20:24 +1100)
Most of the time, flush_tlb_range() is called on single pages.
At the time being, flush_tlb_range() inconditionnaly calls
flush_tlb_mm() which flushes at least the entire PID pages and on
older CPUs like 4xx or 8xx it flushes the entire TLB table.

This patch calls flush_tlb_page() instead of flush_tlb_mm() when
the range is a single page.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/mm/tlb_nohash.c

index bfc4a086960927a3a164eecceb69ab0c4089c365..15fe5f0c8665b0774e2d9e76f487d9a6d9b5978c 100644 (file)
@@ -388,7 +388,10 @@ void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
                     unsigned long end)
 
 {
-       flush_tlb_mm(vma->vm_mm);
+       if (end - start == PAGE_SIZE && !(start & ~PAGE_MASK))
+               flush_tlb_page(vma, start);
+       else
+               flush_tlb_mm(vma->vm_mm);
 }
 EXPORT_SYMBOL(flush_tlb_range);