]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sparc64:mm/hugetlb: Set correct huge_pte_count index for 8M hugepages
authorVijay Kumar <vijay.ac.kumar@oracle.com>
Sun, 2 Oct 2016 21:40:18 +0000 (15:40 -0600)
committerAllen Pais <allen.pais@oracle.com>
Tue, 8 Nov 2016 10:06:32 +0000 (15:36 +0530)
Both set_huge_pte_at(...) and huge_ptep_get_and_clear(...)
call real_hugepage_size_to_pte_count_idx(hugepage_size) when adjusting
huge_pte_count. For 8MB/4MB the huge_pte_count index computed is 1(one).
This is incorrect because this index is for xl_hugepages. So the tsb
grow code in the mm fault path does not grow the tsb for 8MB/4MB
hugepages.

Signed-off-by: Bob Picco <bob.picco@oracle.com>
Signed-off-by: Vijay Kumar <vijay.ac.kumar@oracle.com>
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
Tested-by: Mike Kravetz <mike.kravetz@oracle.com>
Orabug: 24490586
(cherry picked from commit c928d6fccaa59bd4b6cffc904144fa67a4726ff6)
Signed-off-by: Allen Pais <allen.pais@oracle.com>
arch/sparc/include/asm/mmu_64.h
arch/sparc/mm/hugetlbpage.c

index 4db2fa11e346b559be1987db0d31ce2a5aa39127..8c09ef96ae8e9dfd1f821f4cac5bfa2d202bd581 100644 (file)
@@ -134,17 +134,6 @@ static inline unsigned int hugepage_size_to_pte_count_idx(
        return pte_count_index;
 }
 
-static inline unsigned int real_hugepage_size_to_pte_count_idx(
-                               unsigned long real_hugepage_size)
-{
-       unsigned int pte_count_index = MM_PTES_HUGE;
-
-       if (real_hugepage_size != REAL_HPAGE_SIZE)
-               pte_count_index = MM_PTES_XLHUGE;
-
-       return pte_count_index;
-}
-
 void __init hv_establish_xl_hugepage_tsb_descriptor(unsigned short pgsz_idx,
                                                unsigned int pgsz_mask);
 
index cdb08177aaba55cd28d127999fbca77f6722284d..361f431c07b863d334987013d18e78d402e5b12a 100644 (file)
@@ -532,7 +532,7 @@ void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
 
        if (!pte_present(*ptep) && pte_present(entry)) {
                unsigned int pte_count_idx =
-                       real_hugepage_size_to_pte_count_idx(hugepage_size);
+                       hugepage_size_to_pte_count_idx(hugepage_size);
 
                mm->context.huge_pte_count[pte_count_idx]++;
        }
@@ -559,7 +559,7 @@ pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
 
        if (pte_present(entry)) {
                unsigned int pte_count_idx =
-                       real_hugepage_size_to_pte_count_idx(hugepage_size);
+                       hugepage_size_to_pte_count_idx(hugepage_size);
 
                mm->context.huge_pte_count[pte_count_idx]--;
        }