@@ -82,23 +82,20 @@ pte_t ptep_clear_flush(struct vm_area_struct *vma, unsigned long address,
8282}
8383#endif
8484
85+ #ifdef CONFIG_TRANSPARENT_HUGEPAGE
86+
8587#ifndef __HAVE_ARCH_PMDP_SET_ACCESS_FLAGS
8688int pmdp_set_access_flags (struct vm_area_struct * vma ,
8789 unsigned long address , pmd_t * pmdp ,
8890 pmd_t entry , int dirty )
8991{
90- #ifdef CONFIG_TRANSPARENT_HUGEPAGE
9192 int changed = !pmd_same (* pmdp , entry );
9293 VM_BUG_ON (address & ~HPAGE_PMD_MASK );
9394 if (changed ) {
9495 set_pmd_at (vma -> vm_mm , address , pmdp , entry );
9596 flush_tlb_range (vma , address , address + HPAGE_PMD_SIZE );
9697 }
9798 return changed ;
98- #else /* CONFIG_TRANSPARENT_HUGEPAGE */
99- BUG ();
100- return 0 ;
101- #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
10299}
103100#endif
104101
@@ -107,11 +104,7 @@ int pmdp_clear_flush_young(struct vm_area_struct *vma,
107104 unsigned long address , pmd_t * pmdp )
108105{
109106 int young ;
110- #ifdef CONFIG_TRANSPARENT_HUGEPAGE
111107 VM_BUG_ON (address & ~HPAGE_PMD_MASK );
112- #else
113- BUG ();
114- #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
115108 young = pmdp_test_and_clear_young (vma , address , pmdp );
116109 if (young )
117110 flush_tlb_range (vma , address , address + HPAGE_PMD_SIZE );
@@ -120,7 +113,6 @@ int pmdp_clear_flush_young(struct vm_area_struct *vma,
120113#endif
121114
122115#ifndef __HAVE_ARCH_PMDP_HUGE_CLEAR_FLUSH
123- #ifdef CONFIG_TRANSPARENT_HUGEPAGE
124116pmd_t pmdp_huge_clear_flush (struct vm_area_struct * vma , unsigned long address ,
125117 pmd_t * pmdp )
126118{
@@ -131,11 +123,9 @@ pmd_t pmdp_huge_clear_flush(struct vm_area_struct *vma, unsigned long address,
131123 flush_tlb_range (vma , address , address + HPAGE_PMD_SIZE );
132124 return pmd ;
133125}
134- #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
135126#endif
136127
137128#ifndef __HAVE_ARCH_PMDP_SPLITTING_FLUSH
138- #ifdef CONFIG_TRANSPARENT_HUGEPAGE
139129void pmdp_splitting_flush (struct vm_area_struct * vma , unsigned long address ,
140130 pmd_t * pmdp )
141131{
@@ -145,11 +135,9 @@ void pmdp_splitting_flush(struct vm_area_struct *vma, unsigned long address,
145135 /* tlb flush only to serialize against gup-fast */
146136 flush_tlb_range (vma , address , address + HPAGE_PMD_SIZE );
147137}
148- #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
149138#endif
150139
151140#ifndef __HAVE_ARCH_PGTABLE_DEPOSIT
152- #ifdef CONFIG_TRANSPARENT_HUGEPAGE
153141void pgtable_trans_huge_deposit (struct mm_struct * mm , pmd_t * pmdp ,
154142 pgtable_t pgtable )
155143{
@@ -162,11 +150,9 @@ void pgtable_trans_huge_deposit(struct mm_struct *mm, pmd_t *pmdp,
162150 list_add (& pgtable -> lru , & pmd_huge_pte (mm , pmdp )-> lru );
163151 pmd_huge_pte (mm , pmdp ) = pgtable ;
164152}
165- #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
166153#endif
167154
168155#ifndef __HAVE_ARCH_PGTABLE_WITHDRAW
169- #ifdef CONFIG_TRANSPARENT_HUGEPAGE
170156/* no "address" argument so destroys page coloring of some arch */
171157pgtable_t pgtable_trans_huge_withdraw (struct mm_struct * mm , pmd_t * pmdp )
172158{
@@ -185,23 +171,19 @@ pgtable_t pgtable_trans_huge_withdraw(struct mm_struct *mm, pmd_t *pmdp)
185171 }
186172 return pgtable ;
187173}
188- #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
189174#endif
190175
191176#ifndef __HAVE_ARCH_PMDP_INVALIDATE
192- #ifdef CONFIG_TRANSPARENT_HUGEPAGE
193177void pmdp_invalidate (struct vm_area_struct * vma , unsigned long address ,
194178 pmd_t * pmdp )
195179{
196180 pmd_t entry = * pmdp ;
197181 set_pmd_at (vma -> vm_mm , address , pmdp , pmd_mknotpresent (entry ));
198182 flush_tlb_range (vma , address , address + HPAGE_PMD_SIZE );
199183}
200- #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
201184#endif
202185
203186#ifndef pmdp_collapse_flush
204- #ifdef CONFIG_TRANSPARENT_HUGEPAGE
205187pmd_t pmdp_collapse_flush (struct vm_area_struct * vma , unsigned long address ,
206188 pmd_t * pmdp )
207189{
@@ -217,5 +199,5 @@ pmd_t pmdp_collapse_flush(struct vm_area_struct *vma, unsigned long address,
217199 flush_tlb_range (vma , address , address + HPAGE_PMD_SIZE );
218200 return pmd ;
219201}
220- #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
221202#endif
203+ #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
0 commit comments