aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuchun Song <[email protected]>2021-02-04 18:32:13 -0800
committerLinus Torvalds <[email protected]>2021-02-05 11:03:47 -0800
commitecbf4724e6061b4b01be20f6d797d64d462b2bc8 (patch)
tree1b9f4c49190dde2aef7a683f9b8ddab75582060c
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: https://lkml.kernel.org/r/[email protected] Fixes: 7e1f049efb86 ("mm: hugetlb: cleanup using paeg_huge_active()") Signed-off-by: Muchun Song <[email protected]> Reviewed-by: Mike Kravetz <[email protected]> Acked-by: Michal Hocko <[email protected]> Reviewed-by: Oscar Salvador <[email protected]> Cc: David Hildenbrand <[email protected]> Cc: Yang Shi <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--mm/hugetlb.c3
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 */