diff mbox series

[v2,14/26] mm: Allow can_split_folio() to be called when THP are disabled

Message ID 20220504182857.4013401-15-willy@infradead.org (mailing list archive)
State New
Headers show
Series Folio patches for 5.19 | expand

Commit Message

Matthew Wilcox May 4, 2022, 6:28 p.m. UTC
The call to can_split_folio() in vmscan is currently guarded by a test
of PageTransHuge() so the BUILD_BUG() is eliminated if THP are disabled.
The next patch replaces that test with folio_test_large() which may
be true, even when THP are disabled.  However, if THP are disabled,
we cannot split, so an unconditional return of false is appropriate.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 include/linux/huge_mm.h | 1 -
 1 file changed, 1 deletion(-)

Comments

Christoph Hellwig May 5, 2022, 3:38 p.m. UTC | #1
Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>
diff mbox series

Patch

diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h
index 2999190adc22..e9e0d591061d 100644
--- a/include/linux/huge_mm.h
+++ b/include/linux/huge_mm.h
@@ -347,7 +347,6 @@  static inline void prep_transhuge_page(struct page *page) {}
 static inline bool
 can_split_folio(struct folio *folio, int *pextra_pins)
 {
-	BUILD_BUG();
 	return false;
 }
 static inline int