diff options
authorMuchun Song <>2021-02-04 18:32:13 -0800
committerLinus Torvalds <>2021-02-05 11:03:47 -0800
commitecbf4724e6061b4b01be20f6d797d64d462b2bc8 (patch)
parent0eb2df2b5629794020f75e94655e1994af63f0d4 (diff)
mm: hugetlb: remove VM_BUG_ON_PAGE from page_huge_active
The page_huge_active() can be called from scan_movable_pages() which do not hold a reference count to the HugeTLB page. So when we call page_huge_active() from scan_movable_pages(), the HugeTLB page can be freed parallel. Then we will trigger a BUG_ON which is in the page_huge_active() when CONFIG_DEBUG_VM is enabled. Just remove the VM_BUG_ON_PAGE. Link: Fixes: 7e1f049efb86 ("mm: hugetlb: cleanup using paeg_huge_active()") Signed-off-by: Muchun Song <> Reviewed-by: Mike Kravetz <> Acked-by: Michal Hocko <> Reviewed-by: Oscar Salvador <> Cc: David Hildenbrand <> Cc: Yang Shi <> Cc: <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
1 files changed, 1 insertions, 2 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 90e03c3000c5..d78111f0fa2c 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -1361,8 +1361,7 @@ struct hstate *size_to_hstate(unsigned long size)
bool page_huge_active(struct page *page)
- VM_BUG_ON_PAGE(!PageHuge(page), page);
- return PageHead(page) && PagePrivate(&page[1]);
+ return PageHeadHuge(page) && PagePrivate(&page[1]);
/* never called for tail page */