powerpc/book3s64: Export has_transparent_hugepage() related functions.
authorAneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Tue, 24 Sep 2019 04:24:40 +0000 (09:54 +0530)
committerDan Williams <dan.j.williams@intel.com>
Tue, 24 Sep 2019 17:22:29 +0000 (10:22 -0700)
In later patch, we want to use hash_transparent_hugepage() in a kernel module.
Export two related functions.

Acked-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Link: https://lore.kernel.org/r/20190924042440.27946-1-aneesh.kumar@linux.ibm.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
arch/powerpc/include/asm/book3s/64/radix.h
arch/powerpc/mm/book3s64/hash_pgtable.c
arch/powerpc/mm/book3s64/radix_pgtable.c

index e04a839cb5b9f9f273750643684a1d7bf6d1385e..65a6966f1de49e0358da933f83ac50c2eadb815f 100644 (file)
@@ -254,7 +254,13 @@ extern void radix__pgtable_trans_huge_deposit(struct mm_struct *mm, pmd_t *pmdp,
 extern pgtable_t radix__pgtable_trans_huge_withdraw(struct mm_struct *mm, pmd_t *pmdp);
 extern pmd_t radix__pmdp_huge_get_and_clear(struct mm_struct *mm,
                                      unsigned long addr, pmd_t *pmdp);
-extern int radix__has_transparent_hugepage(void);
+static inline int radix__has_transparent_hugepage(void)
+{
+       /* For radix 2M at PMD level means thp */
+       if (mmu_psize_defs[MMU_PAGE_2M].shift == PMD_SHIFT)
+               return 1;
+       return 0;
+}
 #endif
 
 extern int __meminit radix__vmemmap_create_mapping(unsigned long start,
index d1f390ac9cdbffde410f4bff055c67710445d896..64733b9cb20a87ea48e245bf1bbd901d6e8c0f1d 100644 (file)
@@ -406,6 +406,8 @@ int hash__has_transparent_hugepage(void)
 
        return 1;
 }
+EXPORT_SYMBOL_GPL(hash__has_transparent_hugepage);
+
 #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
 
 #ifdef CONFIG_STRICT_KERNEL_RWX
index b4ca9e95e678110e7f0f07fd9a9d6688a1658d5a..dc7a38f0a45ba0a0f87e3c2f01e1e68662b79952 100644 (file)
@@ -1057,13 +1057,6 @@ pmd_t radix__pmdp_huge_get_and_clear(struct mm_struct *mm,
        return old_pmd;
 }
 
-int radix__has_transparent_hugepage(void)
-{
-       /* For radix 2M at PMD level means thp */
-       if (mmu_psize_defs[MMU_PAGE_2M].shift == PMD_SHIFT)
-               return 1;
-       return 0;
-}
 #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
 
 void radix__ptep_set_access_flags(struct vm_area_struct *vma, pte_t *ptep,