aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/asm-generic/pgtable.h14
-rw-r--r--mm/pgtable-generic.c11
2 files changed, 7 insertions, 18 deletions
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
index f1eddf71dd0c..31b6188df221 100644
--- a/include/asm-generic/pgtable.h
+++ b/include/asm-generic/pgtable.h
@@ -87,14 +87,6 @@ static inline pmd_t pmdp_get_and_clear(struct mm_struct *mm,
87 pmd_clear(mm, address, pmdp); 87 pmd_clear(mm, address, pmdp);
88 return pmd; 88 return pmd;
89}) 89})
90#else /* CONFIG_TRANSPARENT_HUGEPAGE */
91static inline pmd_t pmdp_get_and_clear(struct mm_struct *mm,
92 unsigned long address,
93 pmd_t *pmdp)
94{
95 BUG();
96 return __pmd(0);
97}
98#endif /* CONFIG_TRANSPARENT_HUGEPAGE */ 90#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
99#endif 91#endif
100 92
@@ -163,9 +155,9 @@ static inline void pmdp_set_wrprotect(struct mm_struct *mm,
163#endif 155#endif
164 156
165#ifndef __HAVE_ARCH_PMDP_SPLITTING_FLUSH 157#ifndef __HAVE_ARCH_PMDP_SPLITTING_FLUSH
166extern pmd_t pmdp_clear_flush(struct vm_area_struct *vma, 158extern pmd_t pmdp_splitting_flush(struct vm_area_struct *vma,
167 unsigned long address, 159 unsigned long address,
168 pmd_t *pmdp); 160 pmd_t *pmdp);
169#endif 161#endif
170 162
171#ifndef __HAVE_ARCH_PTE_SAME 163#ifndef __HAVE_ARCH_PTE_SAME
diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c
index d030548047e2..0369f5b3ba1b 100644
--- a/mm/pgtable-generic.c
+++ b/mm/pgtable-generic.c
@@ -92,32 +92,29 @@ pte_t ptep_clear_flush(struct vm_area_struct *vma, unsigned long address,
92#endif 92#endif
93 93
94#ifndef __HAVE_ARCH_PMDP_CLEAR_FLUSH 94#ifndef __HAVE_ARCH_PMDP_CLEAR_FLUSH
95#ifdef CONFIG_TRANSPARENT_HUGEPAGE
95pmd_t pmdp_clear_flush(struct vm_area_struct *vma, unsigned long address, 96pmd_t pmdp_clear_flush(struct vm_area_struct *vma, unsigned long address,
96 pmd_t *pmdp) 97 pmd_t *pmdp)
97{ 98{
98 pmd_t pmd; 99 pmd_t pmd;
99#ifndef CONFIG_TRANSPARENT_HUGEPAGE
100 BUG();
101#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
102 VM_BUG_ON(address & ~HPAGE_PMD_MASK); 100 VM_BUG_ON(address & ~HPAGE_PMD_MASK);
103 pmd = pmdp_get_and_clear(vma->vm_mm, address, pmdp); 101 pmd = pmdp_get_and_clear(vma->vm_mm, address, pmdp);
104 flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE); 102 flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE);
105 return pmd; 103 return pmd;
106} 104}
105#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
107#endif 106#endif
108 107
109#ifndef __HAVE_ARCH_PMDP_SPLITTING_FLUSH 108#ifndef __HAVE_ARCH_PMDP_SPLITTING_FLUSH
109#ifdef CONFIG_TRANSPARENT_HUGEPAGE
110pmd_t pmdp_splitting_flush(struct vm_area_struct *vma, unsigned long address, 110pmd_t pmdp_splitting_flush(struct vm_area_struct *vma, unsigned long address,
111 pmd_t *pmdp) 111 pmd_t *pmdp)
112{ 112{
113#ifdef CONFIG_TRANSPARENT_HUGEPAGE
114 pmd_t pmd = pmd_mksplitting(*pmdp); 113 pmd_t pmd = pmd_mksplitting(*pmdp);
115 VM_BUG_ON(address & ~HPAGE_PMD_MASK); 114 VM_BUG_ON(address & ~HPAGE_PMD_MASK);
116 set_pmd_at(vma->vm_mm, address, pmdp, pmd); 115 set_pmd_at(vma->vm_mm, address, pmdp, pmd);
117 /* tlb flush only to serialize against gup-fast */ 116 /* tlb flush only to serialize against gup-fast */
118 flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE); 117 flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE);
119#else /* CONFIG_TRANSPARENT_HUGEPAGE */
120 BUG();
121#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
122} 118}
119#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
123#endif 120#endif