Skip to contentSkip to conversation

exclude page structures of non-dumped pages

PATCH In review Cliff Wickman 1 participant 1 message Dec 9, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 exclude page structures of non-dumped pages

From: Cliff Wickman <[email protected]>

This patch adds a -e option to makedumpfile.
The -e option excludes kernel pages that contain nothing but kernel page structures for pages that are not being included in the dump.

A page structure (56 bytes) exists for every 4096-byte page.
This amounts to 3.67 million pages, or about 14GB, per terabyte of system memory!

Without -e a 2-terabyte system can be dumped (compressed) to a file of about 3.7G. With -e that is reduced to about 590M. And the time and space savings multiply for each additional terabyte of memory in the system.

The only disadvantage is that various options of the crash 'kmem' command (that walk lists of page structures) will not work.

---
 diskdump_mod.h |    1 
 makedumpfile.c |  671 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 makedumpfile.h |   59 ++++-
 print_info.c   |    7 
 4 files changed, 735 insertions(+), 3 deletions(-)
diskdump_mod.h +1 -0
Index: makedumpfile-1.5.7/diskdump_mod.h
===================================================================
@@ -95,6 +95,7 @@ struct kdump_sub_header {
 #define DUMP_DH_COMPRESSED_LZO	0x2	/* paged is compressed with lzo */
 #define DUMP_DH_COMPRESSED_SNAPPY	0x4
 					/* paged is compressed with snappy */
+#define DUMP_DH_EXCLUDED_VMEMMAP 0x8    /* unused vmemmap pages are excluded */
 
 /* descriptor of each page for vmcore */
 typedef struct page_desc {
print_info.c +6 -1
Index: makedumpfile-1.5.7/print_info.c
===================================================================
@@ -58,7 +58,7 @@ print_usage(void)
 	MSG("\n");
 	MSG("Usage:\n");
 	MSG("  Creating DUMPFILE:\n");
-	MSG("  # makedumpfile    [-c|-l|-p|-E] [-d DL] [-j] [-x VMLINUX|-i VMCOREINFO] VMCORE\n");
+	MSG("  # makedumpfile    [-c|-l|-p|-E] [-d DL] [-j] [-e] [-x VMLINUX|-i VMCOREINFO] VMCORE\n");
 	MSG("    DUMPFILE\n");
 	MSG("\n");
 	MSG("  Creating DUMPFILE with filtered kernel data specified through filter config\n");
@@ -111,6 +111,11 @@ print_usage(void)
 	MSG("  [-j]:\n");
 	MSG("      Use raw (O_DIRECT) i/o on dump and bitmap files to avoid expanding kernel pagecache.\n");
 	MSG("\n");
+	MSG("\n");
+	MSG("  [-e]:\n");
+	MSG("      Exclude page structures (vmemmap) for unused pages.\n");
+	MSG("\n");
+	MSG("\n");
 	MSG("  [-d DL]:\n");
 	MSG("      Specify the type of unnecessary page for analysis.\n");
 	MSG("      Pages of the specified type are not copied to DUMPFILE. The page type\n");
makedumpfile.h +58 -1

104 lines not on this page · raw message

makedumpfile.c +670 -1

728 lines not on this page · raw message

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec