range->owner = owner;
}
-#define clear_flush_young_ptes_notify(__vma, __address, __ptep, __nr) \
-({ \
- int __young; \
- struct vm_area_struct *___vma = __vma; \
- unsigned long ___address = __address; \
- unsigned int ___nr = __nr; \
- __young = clear_flush_young_ptes(___vma, ___address, __ptep, ___nr); \
- __young |= mmu_notifier_clear_flush_young(___vma->vm_mm, \
- ___address, \
- ___address + \
- ___nr * PAGE_SIZE); \
- __young; \
-})
-
-#define pmdp_clear_flush_young_notify(__vma, __address, __pmdp) \
-({ \
- int __young; \
- struct vm_area_struct *___vma = __vma; \
- unsigned long ___address = __address; \
- __young = pmdp_clear_flush_young(___vma, ___address, __pmdp); \
- __young |= mmu_notifier_clear_flush_young(___vma->vm_mm, \
- ___address, \
- ___address + \
- PMD_SIZE); \
- __young; \
-})
-
-#define ptep_clear_young_notify(__vma, __address, __ptep) \
-({ \
- int __young; \
- struct vm_area_struct *___vma = __vma; \
- unsigned long ___address = __address; \
- __young = ptep_test_and_clear_young(___vma, ___address, __ptep);\
- __young |= mmu_notifier_clear_young(___vma->vm_mm, ___address, \
- ___address + PAGE_SIZE); \
- __young; \
-})
-
-#define pmdp_clear_young_notify(__vma, __address, __pmdp) \
-({ \
- int __young; \
- struct vm_area_struct *___vma = __vma; \
- unsigned long ___address = __address; \
- __young = pmdp_test_and_clear_young(___vma, ___address, __pmdp);\
- __young |= mmu_notifier_clear_young(___vma->vm_mm, ___address, \
- ___address + PMD_SIZE); \
- __young; \
-})
-
#else /* CONFIG_MMU_NOTIFIER */
struct mmu_notifier_range {
#define mmu_notifier_range_update_to_read_only(r) false
-#define clear_flush_young_ptes_notify clear_flush_young_ptes
-#define pmdp_clear_flush_young_notify pmdp_clear_flush_young
-#define ptep_clear_young_notify ptep_test_and_clear_young
-#define pmdp_clear_young_notify pmdp_test_and_clear_young
-
static inline void mmu_notifier_synchronize(void)
{
}
#include <linux/khugepaged.h>
#include <linux/mm.h>
#include <linux/mm_inline.h>
+#include <linux/mmu_notifier.h>
#include <linux/pagemap.h>
#include <linux/pagewalk.h>
#include <linux/rmap.h>
return remap_pfn_range_complete(vma, addr, pfn, size, prot);
}
+#ifdef CONFIG_MMU_NOTIFIER
+static inline int clear_flush_young_ptes_notify(struct vm_area_struct *vma,
+ unsigned long addr, pte_t *ptep, unsigned int nr)
+{
+ int young;
+
+ young = clear_flush_young_ptes(vma, addr, ptep, nr);
+ young |= mmu_notifier_clear_flush_young(vma->vm_mm, addr,
+ addr + nr * PAGE_SIZE);
+ return young;
+}
+
+static inline int pmdp_clear_flush_young_notify(struct vm_area_struct *vma,
+ unsigned long addr, pmd_t *pmdp)
+{
+ int young;
+
+ young = pmdp_clear_flush_young(vma, addr, pmdp);
+ young |= mmu_notifier_clear_flush_young(vma->vm_mm, addr, addr + PMD_SIZE);
+ return young;
+}
+
+static inline int ptep_clear_young_notify(struct vm_area_struct *vma,
+ unsigned long addr, pte_t *ptep)
+{
+ int young;
+
+ young = ptep_test_and_clear_young(vma, addr, ptep);
+ young |= mmu_notifier_clear_young(vma->vm_mm, addr, addr + PAGE_SIZE);
+ return young;
+}
+
+static inline int pmdp_clear_young_notify(struct vm_area_struct *vma,
+ unsigned long addr, pmd_t *pmdp)
+{
+ int young;
+
+ young = pmdp_test_and_clear_young(vma, addr, pmdp);
+ young |= mmu_notifier_clear_young(vma->vm_mm, addr, addr + PMD_SIZE);
+ return young;
+}
+
+#else /* CONFIG_MMU_NOTIFIER */
+
+#define clear_flush_young_ptes_notify clear_flush_young_ptes
+#define pmdp_clear_flush_young_notify pmdp_clear_flush_young
+#define ptep_clear_young_notify ptep_test_and_clear_young
+#define pmdp_clear_young_notify pmdp_test_and_clear_young
+
+#endif /* CONFIG_MMU_NOTIFIER */
+
#endif /* __MM_INTERNAL_H */