Merge tag 'for-linus-20191012' of git://git.kernel.dk/linux-block
[linux-2.6-microblaze.git] / include / linux / huge_mm.h
index 45ede62..93d5cf0 100644 (file)
@@ -108,7 +108,12 @@ static inline bool __transparent_hugepage_enabled(struct vm_area_struct *vma)
 
        if (transparent_hugepage_flags & (1 << TRANSPARENT_HUGEPAGE_FLAG))
                return true;
-
+       /*
+        * For dax vmas, try to always use hugepage mappings. If the kernel does
+        * not support hugepages, fsdax mappings will fallback to PAGE_SIZE
+        * mappings, and device-dax namespaces, that try to guarantee a given
+        * mapping size, will fail to enable
+        */
        if (vma_is_dax(vma))
                return true;
 
@@ -267,6 +272,15 @@ static inline bool thp_migration_supported(void)
        return IS_ENABLED(CONFIG_ARCH_ENABLE_THP_MIGRATION);
 }
 
+static inline struct list_head *page_deferred_list(struct page *page)
+{
+       /*
+        * Global or memcg deferred list in the second tail pages is
+        * occupied by compound_head.
+        */
+       return &page[2].deferred_list;
+}
+
 #else /* CONFIG_TRANSPARENT_HUGEPAGE */
 #define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; })
 #define HPAGE_PMD_MASK ({ BUILD_BUG(); 0; })