]> git.hungrycats.org Git - linux/commitdiff
[PATCH] hugetlbpage: reinitialise compound page destructor
authorAndrew Morton <akpm@osdl.org>
Thu, 3 Jun 2004 01:02:18 +0000 (18:02 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Thu, 3 Jun 2004 01:02:18 +0000 (18:02 -0700)
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: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
mm/hugetlb.c

index 6acf0d8144549ea4a8d63173314f5a24f6f28168..d676d5ed7cd41917a9f89b4a1ea5be6681568f18 100644 (file)
@@ -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);