Merge tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / include / linux / rmap.h
index 7f32cec57e6744da01f2ba47e1c96e129c56f674..bfe1f4780644434cd8901abae42939d661e70a8e 100644 (file)
@@ -37,14 +37,14 @@ struct anon_vma {
        atomic_t refcount;
 
        /*
-        * NOTE: the LSB of the head.next is set by
+        * NOTE: the LSB of the rb_root.rb_node is set by
         * mm_take_all_locks() _after_ taking the above lock. So the
-        * head must only be read/written after taking the above lock
+        * rb_root must only be read/written after taking the above lock
         * to be sure to see a valid next pointer. The LSB bit itself
         * is serialized by a system wide lock only visible to
         * mm_take_all_locks() (mm_all_locks_mutex).
         */
-       struct list_head head;  /* Chain of private "related" vmas */
+       struct rb_root rb_root; /* Interval tree of private "related" vmas */
 };
 
 /*
@@ -57,14 +57,29 @@ struct anon_vma {
  * with a VMA, or the VMAs associated with an anon_vma.
  * The "same_vma" list contains the anon_vma_chains linking
  * all the anon_vmas associated with this VMA.
- * The "same_anon_vma" list contains the anon_vma_chains
+ * The "rb" field indexes on an interval tree the anon_vma_chains
  * which link all the VMAs associated with this anon_vma.
  */
 struct anon_vma_chain {
        struct vm_area_struct *vma;
        struct anon_vma *anon_vma;
        struct list_head same_vma;   /* locked by mmap_sem & page_table_lock */
-       struct list_head same_anon_vma; /* locked by anon_vma->mutex */
+       struct rb_node rb;                      /* locked by anon_vma->mutex */
+       unsigned long rb_subtree_last;
+#ifdef CONFIG_DEBUG_VM_RB
+       unsigned long cached_vma_start, cached_vma_last;
+#endif
+};
+
+enum ttu_flags {
+       TTU_UNMAP = 0,                  /* unmap mode */
+       TTU_MIGRATION = 1,              /* migration mode */
+       TTU_MUNLOCK = 2,                /* munlock mode */
+       TTU_ACTION_MASK = 0xff,
+
+       TTU_IGNORE_MLOCK = (1 << 8),    /* ignore mlock */
+       TTU_IGNORE_ACCESS = (1 << 9),   /* don't age */
+       TTU_IGNORE_HWPOISON = (1 << 10),/* corrupted page is recoverable */
 };
 
 #ifdef CONFIG_MMU
@@ -160,16 +175,6 @@ int page_referenced(struct page *, int is_locked,
 int page_referenced_one(struct page *, struct vm_area_struct *,
        unsigned long address, unsigned int *mapcount, unsigned long *vm_flags);
 
-enum ttu_flags {
-       TTU_UNMAP = 0,                  /* unmap mode */
-       TTU_MIGRATION = 1,              /* migration mode */
-       TTU_MUNLOCK = 2,                /* munlock mode */
-       TTU_ACTION_MASK = 0xff,
-
-       TTU_IGNORE_MLOCK = (1 << 8),    /* ignore mlock */
-       TTU_IGNORE_ACCESS = (1 << 9),   /* don't age */
-       TTU_IGNORE_HWPOISON = (1 << 10),/* corrupted page is recoverable */
-};
 #define TTU_ACTION(x) ((x) & TTU_ACTION_MASK)
 
 int try_to_unmap(struct page *, enum ttu_flags flags);