pinctrl: nomadik:fix up device tree bindings
[firefly-linux-kernel-4.4.55.git] / mm / internal.h
index 829304090b90e8ff57ee3eaf5281987deccb7e55..efad241f7014805fbe39ae30f1e4c03a6046cfa6 100644 (file)
@@ -108,6 +108,31 @@ extern pmd_t *mm_find_pmd(struct mm_struct *mm, unsigned long address);
 /*
  * in mm/page_alloc.c
  */
+
+/*
+ * Locate the struct page for both the matching buddy in our
+ * pair (buddy1) and the combined O(n+1) page they form (page).
+ *
+ * 1) Any buddy B1 will have an order O twin B2 which satisfies
+ * the following equation:
+ *     B2 = B1 ^ (1 << O)
+ * For example, if the starting buddy (buddy2) is #8 its order
+ * 1 buddy is #10:
+ *     B2 = 8 ^ (1 << 1) = 8 ^ 2 = 10
+ *
+ * 2) Any buddy B will have an order O+1 parent P which
+ * satisfies the following equation:
+ *     P = B & ~(1 << O)
+ *
+ * Assumption: *_mem_map is contiguous at least up to MAX_ORDER
+ */
+static inline unsigned long
+__find_buddy_index(unsigned long page_idx, unsigned int order)
+{
+       return page_idx ^ (1 << order);
+}
+
+extern int __isolate_free_page(struct page *page, unsigned int order);
 extern void __free_pages_bootmem(struct page *page, unsigned int order);
 extern void prep_compound_page(struct page *page, unsigned long order);
 #ifdef CONFIG_MEMORY_FAILURE
@@ -136,13 +161,10 @@ struct compact_control {
        unsigned long migrate_pfn;      /* isolate_migratepages search base */
        enum migrate_mode mode;         /* Async or sync migration mode */
        bool ignore_skip_hint;          /* Scan blocks even if marked skip */
-       bool finished_update_free;      /* True when the zone cached pfns are
-                                        * no longer being updated
-                                        */
-       bool finished_update_migrate;
-
        int order;                      /* order a direct compactor needs */
        const gfp_t gfp_mask;           /* gfp mask of a direct compactor */
+       const int alloc_flags;          /* alloc flags of a direct compactor */
+       const int classzone_idx;        /* zone index of a direct compactor */
        struct zone *zone;
        int contended;                  /* Signal need_sched() or lock
                                         * contention detected during