From b2a34aeb575e90d46ec70f481006717bcbb8ace7 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Wed, 2 Jun 2004 18:02:18 -0700 Subject: [PATCH] [PATCH] hugetlbpage: reinitialise compound page destructor From: David Gibson Currently the hugepage code stores the hugepage destructor in the mapping field of the second of the compound pages. However, this field is never cleared again, which causes tracebacks from free_pages_check() if the hugepage is later destroyed by reducing the number in /proc/sys/vm/nr_hugepages. This patch fixes the bug by clearing the mapping field when the hugepage is freed. Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- mm/hugetlb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 6acf0d8144549..d676d5ed7cd41 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -57,6 +57,7 @@ void free_huge_page(struct page *page) BUG_ON(page_count(page)); INIT_LIST_HEAD(&page->lru); + page[1].mapping = NULL; spin_lock(&hugetlb_lock); enqueue_huge_page(page); -- 2.53.0