aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm/pgtable_64.c
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2013-06-20 05:00:27 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-06-21 02:01:58 -0400
commit1a5272866f87d7fbf04dc8060f8da3e8456490ab (patch)
treecaaff51d526d91200d9463d6d5e6f22c37ee11ce /arch/powerpc/mm/pgtable_64.c
parent437d496457a30ce9ccccb94b2373c201b2558392 (diff)
powerpc: Optimize hugepage invalidate
Hugepage invalidate involves invalidating multiple hpte entries. Optimize the operation using H_BULK_REMOVE on lpar platforms. On native, reduce the number of tlb flush. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/mm/pgtable_64.c')
-rw-r--r--arch/powerpc/mm/pgtable_64.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c
index 074a4a225054..536eec72c0f7 100644
--- a/arch/powerpc/mm/pgtable_64.c
+++ b/arch/powerpc/mm/pgtable_64.c
@@ -708,6 +708,7 @@ void hpte_do_hugepage_flush(struct mm_struct *mm, unsigned long addr,
708{ 708{
709 int ssize, i; 709 int ssize, i;
710 unsigned long s_addr; 710 unsigned long s_addr;
711 int max_hpte_count;
711 unsigned int psize, valid; 712 unsigned int psize, valid;
712 unsigned char *hpte_slot_array; 713 unsigned char *hpte_slot_array;
713 unsigned long hidx, vpn, vsid, hash, shift, slot; 714 unsigned long hidx, vpn, vsid, hash, shift, slot;
@@ -727,9 +728,16 @@ void hpte_do_hugepage_flush(struct mm_struct *mm, unsigned long addr,
727 728
728 /* get the base page size */ 729 /* get the base page size */
729 psize = get_slice_psize(mm, s_addr); 730 psize = get_slice_psize(mm, s_addr);
730 shift = mmu_psize_defs[psize].shift;
731 731
732 for (i = 0; i < (HPAGE_PMD_SIZE >> shift); i++) { 732 if (ppc_md.hugepage_invalidate)
733 return ppc_md.hugepage_invalidate(mm, hpte_slot_array,
734 s_addr, psize);
735 /*
736 * No bluk hpte removal support, invalidate each entry
737 */
738 shift = mmu_psize_defs[psize].shift;
739 max_hpte_count = HPAGE_PMD_SIZE >> shift;
740 for (i = 0; i < max_hpte_count; i++) {
733 /* 741 /*
734 * 8 bits per each hpte entries 742 * 8 bits per each hpte entries
735 * 000| [ secondary group (one bit) | hidx (3 bits) | valid bit] 743 * 000| [ secondary group (one bit) | hidx (3 bits) | valid bit]