summaryrefslogtreecommitdiff
path: root/include/linux/pagemap.h
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2024-07-06 21:44:41 +0300
committerAndrew Morton <akpm@linux-foundation.org>2024-07-06 21:44:41 +0300
commit8ef6fd0e9ea83a792ba53882ddc6e0d38ce0d636 (patch)
treeb119eaeb76c7afb8672d30078ab7061cb7be67fb /include/linux/pagemap.h
parent44195d1eba826a8af0afbcfa69ab4cc26f6ead7f (diff)
parent1e3d28fe03cdac1f58402e4da1e1e59fb70d145f (diff)
downloadlinux-8ef6fd0e9ea83a792ba53882ddc6e0d38ce0d636.tar.xz
Merge branch 'mm-hotfixes-stable' into mm-stable to pick up "mm: fix
crashes from deferred split racing folio migration", needed by "mm: migrate: split folio_migrate_mapping()".
Diffstat (limited to 'include/linux/pagemap.h')
-rw-r--r--include/linux/pagemap.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index eef99375dcf1..6e2f72d03176 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -354,11 +354,18 @@ static inline void mapping_set_gfp_mask(struct address_space *m, gfp_t mask)
* a good order (that's 1MB if you're using 4kB pages)
*/
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
-#define MAX_PAGECACHE_ORDER HPAGE_PMD_ORDER
+#define PREFERRED_MAX_PAGECACHE_ORDER HPAGE_PMD_ORDER
#else
-#define MAX_PAGECACHE_ORDER 8
+#define PREFERRED_MAX_PAGECACHE_ORDER 8
#endif
+/*
+ * xas_split_alloc() does not support arbitrary orders. This implies no
+ * 512MB THP on ARM64 with 64KB base page size.
+ */
+#define MAX_XAS_ORDER (XA_CHUNK_SHIFT * 2 - 1)
+#define MAX_PAGECACHE_ORDER min(MAX_XAS_ORDER, PREFERRED_MAX_PAGECACHE_ORDER)
+
/**
* mapping_set_large_folios() - Indicate the file supports large folios.
* @mapping: The file.