Commit b2a34aeb authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] hugetlbpage: reinitialise compound page destructor

From: David Gibson <david@gibson.dropbear.id.au>

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: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 50ce176c
...@@ -57,6 +57,7 @@ void free_huge_page(struct page *page) ...@@ -57,6 +57,7 @@ void free_huge_page(struct page *page)
BUG_ON(page_count(page)); BUG_ON(page_count(page));
INIT_LIST_HEAD(&page->lru); INIT_LIST_HEAD(&page->lru);
page[1].mapping = NULL;
spin_lock(&hugetlb_lock); spin_lock(&hugetlb_lock);
enqueue_huge_page(page); enqueue_huge_page(page);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment