mm/hugetlb: clear compound_mapcount when freeing gigantic pages
[cascardo/linux.git] / mm / hugetlb.c
index ee03021..c1f3c0b 100644 (file)
@@ -1030,6 +1030,7 @@ static void destroy_compound_gigantic_page(struct page *page,
        int nr_pages = 1 << order;
        struct page *p = page + 1;
 
+       atomic_set(compound_mapcount_ptr(page), 0);
        for (i = 1; i < nr_pages; i++, p = mem_map_next(p, page, i)) {
                clear_compound_head(p);
                set_page_refcounted(p);