aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrea Arcangeli <aarcange@redhat.com>2011-01-13 18:46:44 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-13 20:32:41 -0500
commit91a4ee2670e0ee2b0630a0eb24fb9a87ea3acd0a (patch)
tree28b3fa3535295544928329290c365eecc5a770d2
parent8ac1f8320a0073f28cf9e0491af4cd98f504f92a (diff)
thp: add pmd mmu_notifier helpers
Add mmu notifier helpers to handle pmd huge operations. Signed-off-by: Andrea Arcangeli <aarcange@redhat.com> Acked-by: Rik van Riel <riel@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--include/linux/mmu_notifier.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h
index 43dcfbdc39de..cbfab1e9957d 100644
--- a/include/linux/mmu_notifier.h
+++ b/include/linux/mmu_notifier.h
@@ -243,6 +243,32 @@ static inline void mmu_notifier_mm_destroy(struct mm_struct *mm)
243 __pte; \ 243 __pte; \
244}) 244})
245 245
246#define pmdp_clear_flush_notify(__vma, __address, __pmdp) \
247({ \
248 pmd_t __pmd; \
249 struct vm_area_struct *___vma = __vma; \
250 unsigned long ___address = __address; \
251 VM_BUG_ON(__address & ~HPAGE_PMD_MASK); \
252 mmu_notifier_invalidate_range_start(___vma->vm_mm, ___address, \
253 (__address)+HPAGE_PMD_SIZE);\
254 __pmd = pmdp_clear_flush(___vma, ___address, __pmdp); \
255 mmu_notifier_invalidate_range_end(___vma->vm_mm, ___address, \
256 (__address)+HPAGE_PMD_SIZE); \
257 __pmd; \
258})
259
260#define pmdp_splitting_flush_notify(__vma, __address, __pmdp) \
261({ \
262 struct vm_area_struct *___vma = __vma; \
263 unsigned long ___address = __address; \
264 VM_BUG_ON(__address & ~HPAGE_PMD_MASK); \
265 mmu_notifier_invalidate_range_start(___vma->vm_mm, ___address, \
266 (__address)+HPAGE_PMD_SIZE);\
267 pmdp_splitting_flush(___vma, ___address, __pmdp); \
268 mmu_notifier_invalidate_range_end(___vma->vm_mm, ___address, \
269 (__address)+HPAGE_PMD_SIZE); \
270})
271
246#define ptep_clear_flush_young_notify(__vma, __address, __ptep) \ 272#define ptep_clear_flush_young_notify(__vma, __address, __ptep) \
247({ \ 273({ \
248 int __young; \ 274 int __young; \
@@ -254,6 +280,17 @@ static inline void mmu_notifier_mm_destroy(struct mm_struct *mm)
254 __young; \ 280 __young; \
255}) 281})
256 282
283#define pmdp_clear_flush_young_notify(__vma, __address, __pmdp) \
284({ \
285 int __young; \
286 struct vm_area_struct *___vma = __vma; \
287 unsigned long ___address = __address; \
288 __young = pmdp_clear_flush_young(___vma, ___address, __pmdp); \
289 __young |= mmu_notifier_clear_flush_young(___vma->vm_mm, \
290 ___address); \
291 __young; \
292})
293
257#define set_pte_at_notify(__mm, __address, __ptep, __pte) \ 294#define set_pte_at_notify(__mm, __address, __ptep, __pte) \
258({ \ 295({ \
259 struct mm_struct *___mm = __mm; \ 296 struct mm_struct *___mm = __mm; \
@@ -305,7 +342,10 @@ static inline void mmu_notifier_mm_destroy(struct mm_struct *mm)
305} 342}
306 343
307#define ptep_clear_flush_young_notify ptep_clear_flush_young 344#define ptep_clear_flush_young_notify ptep_clear_flush_young
345#define pmdp_clear_flush_young_notify pmdp_clear_flush_young
308#define ptep_clear_flush_notify ptep_clear_flush 346#define ptep_clear_flush_notify ptep_clear_flush
347#define pmdp_clear_flush_notify pmdp_clear_flush
348#define pmdp_splitting_flush_notify pmdp_splitting_flush
309#define set_pte_at_notify set_pte_at 349#define set_pte_at_notify set_pte_at
310 350
311#endif /* CONFIG_MMU_NOTIFIER */ 351#endif /* CONFIG_MMU_NOTIFIER */