aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/kexec.c
diff options
context:
space:
mode:
authorAtsushi Kumagai <kumagai-atsushi@mxc.nes.nec.co.jp>2013-02-27 20:03:25 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-27 22:10:12 -0500
commit8d67091ec6ae98ca67f77990ef9e9ec21337f077 (patch)
treecbf544b65762c4b20c50bd50578f8a383a913d78 /kernel/kexec.c
parent6f977e6b2f75fdaccfd9be82bbf72fe5c60e8807 (diff)
kexec: add the values related to buddy system for filtering free pages.
tAdd adds the values related to buddy system to vmcoreinfo data so that makedumpfile (dump filtering command) can filter out all free pages with the new logic. It's faster than the current logic because it can distinguish free page by analyzing page structure at the same time as filtering for other unnecessary pages (e.g. anonymous page). OTOH, the current logic has to trace free_list to distinguish free pages while analyzing page structure to filter out other unnecessary pages. The new logic uses the fact that buddy page is marked by _mapcount == PAGE_BUDDY_MAPCOUNT_VALUE. But, _mapcount shares its memory with other fields for SLAB/SLUB when PG_slab is set, so we need to check if PG_slab is set or not before looking up _mapcount value. And we can get the order of buddy system from private field. To sum it up, the values below are required for this logic. Required values: - OFFSET(page._mapcount) - OFFSET(page.private) - NUMBER(PG_slab) - NUMBER(PAGE_BUDDY_MAPCOUNT_VALUE) Changelog from v1 to v2: 1. remove SIZE(pageflags) The new logic was changed after I sent v1 patch. Accordingly, SIZE(pageflags) has been unnecessary for makedumpfile. What's makedumpfile: makedumpfile creates a small dumpfile by excluding unnecessary pages for the analysis. To distinguish unnecessary pages, makedumpfile gets the vmcoreinfo data which has the minimum debugging information only for dump filtering. Signed-off-by: Atsushi Kumagai <kumagai-atsushi@mxc.nes.nec.co.jp> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Acked-by: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/kexec.c')
-rw-r--r--kernel/kexec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/kexec.c b/kernel/kexec.c
index 2436ffcec91f..7d44a9f94145 100644
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
@@ -1514,6 +1514,8 @@ static int __init crash_save_vmcoreinfo_init(void)
1514 VMCOREINFO_OFFSET(page, _count); 1514 VMCOREINFO_OFFSET(page, _count);
1515 VMCOREINFO_OFFSET(page, mapping); 1515 VMCOREINFO_OFFSET(page, mapping);
1516 VMCOREINFO_OFFSET(page, lru); 1516 VMCOREINFO_OFFSET(page, lru);
1517 VMCOREINFO_OFFSET(page, _mapcount);
1518 VMCOREINFO_OFFSET(page, private);
1517 VMCOREINFO_OFFSET(pglist_data, node_zones); 1519 VMCOREINFO_OFFSET(pglist_data, node_zones);
1518 VMCOREINFO_OFFSET(pglist_data, nr_zones); 1520 VMCOREINFO_OFFSET(pglist_data, nr_zones);
1519#ifdef CONFIG_FLAT_NODE_MEM_MAP 1521#ifdef CONFIG_FLAT_NODE_MEM_MAP
@@ -1536,6 +1538,8 @@ static int __init crash_save_vmcoreinfo_init(void)
1536 VMCOREINFO_NUMBER(PG_lru); 1538 VMCOREINFO_NUMBER(PG_lru);
1537 VMCOREINFO_NUMBER(PG_private); 1539 VMCOREINFO_NUMBER(PG_private);
1538 VMCOREINFO_NUMBER(PG_swapcache); 1540 VMCOREINFO_NUMBER(PG_swapcache);
1541 VMCOREINFO_NUMBER(PG_slab);
1542 VMCOREINFO_NUMBER(PAGE_BUDDY_MAPCOUNT_VALUE);
1539 1543
1540 arch_crash_save_vmcoreinfo(); 1544 arch_crash_save_vmcoreinfo();
1541 update_vmcoreinfo_note(); 1545 update_vmcoreinfo_note();