Skip to content

Commit 421f1ab

Browse files
author
Matthew Wilcox (Oracle)
committed
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) <[email protected]>
1 parent 06d4414 commit 421f1ab

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

include/linux/pagemap.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,14 @@ static inline void mapping_set_large_folios(struct address_space *mapping)
306306
__set_bit(AS_LARGE_FOLIO_SUPPORT, &mapping->flags);
307307
}
308308

309+
/*
310+
* Large folio support currently depends on THP. These dependencies are
311+
* being worked on but are not yet fixed.
312+
*/
309313
static inline bool mapping_large_folio_support(struct address_space *mapping)
310314
{
311-
return test_bit(AS_LARGE_FOLIO_SUPPORT, &mapping->flags);
315+
return IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE) &&
316+
test_bit(AS_LARGE_FOLIO_SUPPORT, &mapping->flags);
312317
}
313318

314319
static inline int filemap_nr_thps(struct address_space *mapping)

0 commit comments

Comments
 (0)