From: Matthew Wilcox (Oracle) Date: Fri, 13 May 2022 03:23:03 +0000 (-0700) Subject: mm: allow can_split_folio() to be called when THP are disabled X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=dc786690a6a1d9a680e6872821291ad7ca9f520d;p=linux.git mm: allow can_split_folio() to be called when THP are disabled 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. Link: https://lkml.kernel.org/r/20220504182857.4013401-15-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton --- diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index 9a26bd10e083b..fbf36bb1be228 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h @@ -348,7 +348,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