summaryrefslogtreecommitdiff
path: root/include/linux/pagemap.h
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2022-01-15 23:27:08 -0500
committerMatthew Wilcox (Oracle) <willy@infradead.org>2022-03-21 13:01:36 -0400
commit421f1ab48452af48b64e205de1caca3d1ba415f4 (patch)
tree49c1c82581c8e35f59f8ad318fc68896d8bf5597 /include/linux/pagemap.h
parent06d44142d49dc2e02d255ea9d72dc4c20f20388f (diff)
mm: Make large folios depend on THP
Some parts of the VM still depend on THP to handle large folios correctly. Until those are fixed, prevent creating large folios if THP are disabled. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Diffstat (limited to 'include/linux/pagemap.h')
-rw-r--r--include/linux/pagemap.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 0a2417fc531c..20d7cbabf654 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -306,9 +306,14 @@ static inline void mapping_set_large_folios(struct address_space *mapping)
__set_bit(AS_LARGE_FOLIO_SUPPORT, &mapping->flags);
}
+/*
+ * Large folio support currently depends on THP. These dependencies are
+ * being worked on but are not yet fixed.
+ */
static inline bool mapping_large_folio_support(struct address_space *mapping)
{
- return test_bit(AS_LARGE_FOLIO_SUPPORT, &mapping->flags);
+ return IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE) &&
+ test_bit(AS_LARGE_FOLIO_SUPPORT, &mapping->flags);
}
static inline int filemap_nr_thps(struct address_space *mapping)