Skip to contentSkip to conversation

exclude page structures of non-dumped pages

PATCH In review Cliff Wickman 1 participant 1 message Jun 29, 2015

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

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

From: Cliff Wickman <[email protected]>

Applies to version 1.5.8

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.
There is a corresponding patch for crash to issue a warning about such commands when the dump is flagged DUMP_DH_EXCLUDED_VMEMMAP.

---
 diskdump_mod.h |    2 
 makedumpfile.c |  672 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 makedumpfile.h |   60 +++++
 print_info.c   |    6 
 4 files changed, 737 insertions(+), 3 deletions(-)
print_info.c +5 -1
Index: makedumpfile/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");
@@ -113,6 +113,10 @@ print_usage(void)
 	MSG("      This allows the dump of a very large memory within a constricted\n");
 	MSG("      (e.g. 450M) crashkernel space.\n");
 	MSG("\n");
+	MSG("  [-e]:\n");
+	MSG("      Exclude page structures (vmemmap) for unused pages.\n");
+	MSG("      This greatly shortens the dump of a very large memory system.\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 +59 -1

111 lines not on this page · raw message

makedumpfile.c +671 -1

736 lines not on this page · raw message

diskdump_mod.h +2 -0
Index: makedumpfile/diskdump_mod.h
===================================================================
@@ -61,6 +61,7 @@ struct disk_dump_header {
 						 * the dump device */
 	unsigned int		written_blocks; /* Number of written blocks */
 	unsigned int		current_cpu;	/* CPU# which handles dump */
+
 	int			nr_cpus;	/* Number of CPUs */
 	struct task_struct	*tasks[0];
 };
@@ -97,6 +98,7 @@ struct kdump_sub_header {
 					/* paged is compressed with snappy */
 #define DUMP_DH_COMPRESSED_INCOMPLETE	0x8
 					/* indicate an incomplete dumpfile */
+#define DUMP_DH_EXCLUDED_VMEMMAP 0x10	/* unused vmemmap pages are excluded */
 
 /* descriptor of each page for vmcore */
 typedef struct page_desc {

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