]> git.baikalelectronics.ru Git - kernel.git/commit
kexec: export free_huge_page to VMCOREINFO
authorAtsushi Kumagai <kumagai-atsushi@mxc.nes.nec.co.jp>
Wed, 30 Jul 2014 23:08:39 +0000 (16:08 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 31 Jul 2014 00:16:13 +0000 (17:16 -0700)
commitd183d55a891cafe8860c6f32c205ed85788a1fe2
tree958c513631bd5419175d7a156268e0425b07cdcc
parent68593f624d09ff55951115d6c76dcd9bda2ad91e
kexec: export free_huge_page to VMCOREINFO

PG_head_mask was added into VMCOREINFO to filter huge pages in 7041bee115a
("kexec: save PG_head_mask in VMCOREINFO"), but makedumpfile still need
another symbol to filter *hugetlbfs* pages.

If a user hope to filter user pages, makedumpfile tries to exclude them by
checking the condition whether the page is anonymous, but hugetlbfs pages
aren't anonymous while they also be user pages.

We know it's possible to detect them in the same way as PageHuge(),
so we need the start address of free_huge_page():

    int PageHuge(struct page *page)
    {
            if (!PageCompound(page))
                    return 0;

            page = compound_head(page);
            return get_compound_page_dtor(page) == free_huge_page;
    }

For that reason, this patch changes free_huge_page() into public
to export it to VMCOREINFO.

Signed-off-by: Atsushi Kumagai <kumagai-atsushi@mxc.nes.nec.co.jp>
Acked-by: Baoquan He <bhe@redhat.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/hugetlb.h
kernel/kexec.c
mm/hugetlb.c