[Crash-utility] [PATCH] crash: note excluded page structures

Dave Anderson anderson at redhat.com
Wed Nov 4 14:29:21 UTC 2015


Hi Cliff,

As I mentioned on kexec-list, since I didn't get any response to 
my two replies to your patch, I went ahead and added a crash patch
when I saw your patch checked into the devel branch of makedumpfile:
 
  https://github.com/crash-utility/crash/commit/7ce8469f8bf7e32017f8270ecd22469040817ba2

When posting patches in the future, it's always preferable if they're
against the git repo source tree.  

Thanks,
  Dave



----- Original Message -----
> 
> 
> 
> If makedumpfile (-e) excludes unused page structures it will flag that
> fact in the dump header.
> 
> (There are about 3.67 million pages full of page structures for
>  every tera byte of system memory.  The great bulk of those
>  page structures are not needed.)
> 
> Crash will display a note during initialization if such structures
> have been excluded.  Crash commands that walk page freelists, for
> example, will fail. So the note will help the user understand why.
> 
> This exclusion of page structures is enabled by this makedumpfile patch:
>  [PATCH V7] makedumpfile: exclude page structures of non-dumped pages
>  http://marc.info/?l=kexec&m=144600721032695&w=2
> 
> (I had said in that patch that the crash patch was already in crash -- but
>  it wasn't.  It was only in my local copy of crash)
> 
> Signed-off-by: Cliff Wickman <cpw at sgi.com>
> ---
>  defs.h     |    1 +
>  diskdump.c |    3 +++
>  diskdump.h |    1 +
>  main.c     |   11 +++++++++++
>  4 files changed, 16 insertions(+)
> 
> Index: crash-7.1.3/diskdump.c
> ===================================================================
> --- crash-7.1.3.orig/diskdump.c
> +++ crash-7.1.3/diskdump.c
> @@ -816,6 +816,9 @@ restart:
>  				dd->valid_pages[i]++;
>  	}
>  
> +	if (header->status & DUMP_DH_EXCLUDED_VMEMMAP)
> +		pc->flags2 |= VMEXCLUDED;
> +
>          return TRUE;
>  
>  err:
> Index: crash-7.1.3/diskdump.h
> ===================================================================
> --- crash-7.1.3.orig/diskdump.h
> +++ crash-7.1.3/diskdump.h
> @@ -85,6 +85,7 @@ struct kdump_sub_header {
>  #define DUMP_DH_COMPRESSED_LZO     0x2   /* page is compressed with lzo */
>  #define DUMP_DH_COMPRESSED_SNAPPY  0x4   /* page is compressed with snappy
>  */
>  #define DUMP_DH_COMPRESSED_INCOMPLETE  0x8   /* dumpfile is incomplete */
> +#define DUMP_DH_EXCLUDED_VMEMMAP   0x10  /* unused vmemmap pages are
> excluded */
>  
>  /* descriptor of each page for vmcore */
>  typedef struct page_desc {
> Index: crash-7.1.3/defs.h
> ===================================================================
> --- crash-7.1.3.orig/defs.h
> +++ crash-7.1.3/defs.h
> @@ -519,6 +519,7 @@ struct program_context {
>  #define is_incomplete_dump() (pc->flags2 & INCOMPLETE_DUMP)
>  #define QEMU_MEM_DUMP_COMPRESSED (0x10000ULL)
>  #define SNAP        (0x20000ULL)
> +#define VMEXCLUDED  (0x40000ULL)
>  	char *cleanup;
>  	char *namelist_orig;
>  	char *namelist_debug_orig;
> Index: crash-7.1.3/main.c
> ===================================================================
> --- crash-7.1.3.orig/main.c
> +++ crash-7.1.3/main.c
> @@ -759,6 +759,17 @@ main_loop(void)
>  	} else
>  		SIGACTION(SIGINT, restart, &pc->sigaction, NULL);
>  
> +	if (pc->flags2 & VMEXCLUDED)
> +		fprintf(fp,
> +	"WARNING: The vmemmap page structures that are associated with the\n"
> +	"         memory pages excluded by the \"makedumpfile -d <level>\"\n"
> +	"         option have been excluded from this dump.\n"
> +	"         The administrator has used \"makedumpfile -e\".\n"
> +	"         This will cause failures in any command that accesses a page\n"
> +	"         structure of a page that is not included in the dump.  This\n"
> +	"         is particularly likely when using several options of the\n"
> +	"         kmem command.\n\n");
> +
>          /*
>           *  Display system statistics and current context.
>           */
> 




More information about the Crash-utility mailing list