Skip to contentSkip to conversation

makedumpfile: exclude page structures of non-dumped pages

PATCH Superseded Cliff Wickman 1 participant 1 message Sep 10, 2015

Subsystems (2)

v4 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 makedumpfile: exclude page structures of non-dumped pages

From: Cliff Wickman <[email protected]>

This patch has been submitted before (see Jun29 2015), but as part of a 2-patch set. That set included a direct i/o option, but that idea has been dropped as unnecessary.
Also submitted on Aug28, and those review comments incorporated.

This patch applies after patch:
[PATCH V2] makedumpfile: make --work-dir easier to use

I have been testing on large memory systems to demonstrate the importance of this feature to such systems. See some numbers below.

The most dramatic demonstration was on a 32TB system where the patch reduced the process from 2 hours to 26 minutes. The size of the dump would probably have been over 30GB (but I ran out of disk space). It was reduced to 5.4GB.

Applies to the development branch as of 9/3/2015.

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. The -e option only works in non-cyclic mode, which its use implies.

Per Kumagai's suggestion:
The -e requires the use of --work-dir, as it will create a pfn file in that work directory. (No check of info->flag_cyclic is made, as the use of the filesystem for the bitmap replaces the use of a large amount of memory.)

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 an idle 2-terabyte system can be dumped (compressed) to a file of about 3.6G.
With -e that is reduced to about 456M. And the time and space savings multiply for each additional terabyte of memory in the system.

Experimental time/size results: (basically idle systems)

Memory Size With -e Without -e

		(sec.)			(sec.)
(using a sles11sp3 kernel that does not provide mmap of /proc/vmcore:)
1TB		   52 244M		  257  1.7G
2TB		  128 456M		  526  3.6G

8TB 780 1.6G 3400 13.8G
16TB 2600 3.1G 9800 (extrapolated, 2:40 is too long to wait)
(using a sles11sp3 kernel that provides mmap of /proc/vmcore:)
16TB 900 3.8G not done
32TB 6000 5.4G not done
(using a sles11sp3 kernel that provides mmap of /proc/vmcore:)
32TB 1600 5.4G 7300 (extrapolated)
(ran out of 19G space before 1/2 done)

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.

Sorry that this patch is large. The vmemmap page scan is done by some very large functions, and they are all interrelated. I didn't see any point to breaking them into several inter-dependent patches.

---
 diskdump_mod.h |    1 
 makedumpfile.c |  661 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 makedumpfile.h |   59 +++++
 print_info.c   |   10 
 4 files changed, 728 insertions(+), 3 deletions(-)
print_info.c +9 -1
Index: code/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] [-x VMLINUX|-i VMCOREINFO] VMCORE\n");
+	MSG("  # makedumpfile    [-c|-l|-p|-E] [-d DL] [-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,14 @@ print_usage(void)
 	MSG("      -E option, because the ELF format does not support compressed data.\n");
 	MSG("      THIS IS ONLY FOR THE CRASH UTILITY.\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("      The --work-dir option must also be specified, as it will be used\n");
+	MSG("      to hold bitmaps and a file of page numbers that are to be excluded.\n");
+	MSG("      The -e option will cause a noncyclic dump procedure.\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

110 lines not on this page · raw message

makedumpfile.c +660 -1

732 lines not on this page · raw message

diskdump_mod.h +1 -0
Index: code/diskdump_mod.h
===================================================================
@@ -97,6 +97,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