[PATCH] kexec: Add compound_order/compound_dtor to VMCOREINFO

From: Atsushi Kumagai
Date: Wed Jan 27 2016 - 02:24:29 EST


makedumpfile refers to page.lru.next to get the order of compound pages
for page filtering. However, now the order is stored in page.compound_order,
hence VMCOREINFO should be updated to export the offset of page.compound_order.

The fact is, page.compound_order was introduced already in kernel 4.0,
but the offset of it was the same as page.lru.next until kernel 4.3,
so this was not actual problem.

The above can be said also for page.lru.prev, it contained the address of
destructor for compound pages but it was moved to page.compound_dtor.
It's necessary to detect hugetlbfs pages. Further, the content of
page.compound_dtor was changed from direct address of destructor to the
ID of it.

Signed-off-by: Atsushi Kumagai <ats-kumagai@xxxxxxxxxxxxx>
---
kernel/kexec_core.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c
index 11b64a6..8c7a6e8 100644
--- a/kernel/kexec_core.c
+++ b/kernel/kexec_core.c
@@ -1388,6 +1388,8 @@ static int __init crash_save_vmcoreinfo_init(void)
VMCOREINFO_OFFSET(page, lru);
VMCOREINFO_OFFSET(page, _mapcount);
VMCOREINFO_OFFSET(page, private);
+ VMCOREINFO_OFFSET(page, compound_dtor);
+ VMCOREINFO_OFFSET(page, compound_order);
VMCOREINFO_OFFSET(pglist_data, node_zones);
VMCOREINFO_OFFSET(pglist_data, nr_zones);
#ifdef CONFIG_FLAT_NODE_MEM_MAP
@@ -1420,8 +1422,8 @@ static int __init crash_save_vmcoreinfo_init(void)
#ifdef CONFIG_X86
VMCOREINFO_NUMBER(KERNEL_IMAGE_SIZE);
#endif
-#ifdef CONFIG_HUGETLBFS
- VMCOREINFO_SYMBOL(free_huge_page);
+#ifdef CONFIG_HUGETLB_PAGE
+ VMCOREINFO_NUMBER(HUGETLB_PAGE_DTOR);
#endif

arch_crash_save_vmcoreinfo();
--
1.9.0