[Crash-utility] [PATCH 1/1 V4] crash: initial note of excluded page structures

Dave Anderson anderson at redhat.com
Fri Jan 10 19:23:02 UTC 2014



----- Original Message -----
> 
> 
> 
> Version 4
> - Makes the warning:
> 
> WARNING: The vmemmap page structures that are associated with the
>          memory pages excluded by the "makedumpfile -d <level>"
>          option have been excluded from this dump.
>          The administrator has used "makedumpfile -e".
>          This will cause failures in any command that accesses a page
>          structure of a page that is not included in the dump.  This
>          is particularly likely when using several options of the
>          kmem command.
> 
> Version 3
> - Changes the warning to be more complete:
> 
> WARNING: All unused vmemmap page structures are excluded from this dump.
>          This will cause failures of the kmem command if it attempts to
>          walk any list of free pages (with options such as -f -F -i -s
>          and -S) or interpret an address with kmem <address>, and
>          incorrect output from kmem -p.
> 
> Version 2
> - Moves the warning to this point:
>       ...
>       This GDB was configured as "x86_64-unknown-linux-gnu"...
> 
>       WARNING: All unused vmemmap page structures are excluded from this
>       dump.
>                This will cause failures of the kmem command if it attempts to
>                walk any list of free pages (with options -f -F -i -s and -S).
> 
>         SYSTEM MAP: /boot/System.map-2.6.32-cpw
>       ...
> 
> - Drop patch 2, which added warnings to individual kmem options.
> 
> - Feel free to change the wording of the warning.
> 
> And this patch is contingent upon the acceptance of a change to the
> makedumpfile command.
>    http://marc.info/?l=kexec&m=138853299130125&w=2
>   
> 
> If makedumpfile 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.)
> Their exclusion is a makedumpfile option.
> 
> 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.
> 
> 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.0.4/diskdump.c
> ===================================================================
> --- crash-7.0.4.orig/diskdump.c
> +++ crash-7.0.4/diskdump.c
> @@ -749,6 +749,9 @@ restart:
>  				dd->valid_pages[i]++;
>  	}
>  
> +	if (header->status & DUMP_DH_EXCLUDED_VMEMMAP)
> +		pc->flags2 |= VMEXCLUDED;
> +
>          return TRUE;
>  
>  err:
> Index: crash-7.0.4/diskdump.h
> ===================================================================
> --- crash-7.0.4.orig/diskdump.h
> +++ crash-7.0.4/diskdump.h
> @@ -84,6 +84,7 @@ struct kdump_sub_header {
>  #define DUMP_DH_COMPRESSED_ZLIB    0x1   /* page is compressed with zlib */
>  #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_EXCLUDED_VMEMMAP   0x8   /* unused vmemmap pages are
> excluded */
>  
>  /* descriptor of each page for vmcore */
>  typedef struct page_desc {
> Index: crash-7.0.4/defs.h
> ===================================================================
> --- crash-7.0.4.orig/defs.h
> +++ crash-7.0.4/defs.h
> @@ -505,6 +505,7 @@ struct program_context {
>  #define VMCOREINFO    (0x400ULL)
>  #define ALLOW_FP      (0x800ULL)
>  #define REM_PAUSED_F (0x1000ULL)
> +#define VMEXCLUDED   (0x2000ULL)
>  #define REMOTE_PAUSED() (pc->flags2 & REM_PAUSED_F)
>  	char *cleanup;
>  	char *namelist_orig;
> Index: crash-7.0.4/main.c
> ===================================================================
> --- crash-7.0.4.orig/main.c
> +++ crash-7.0.4/main.c
> @@ -662,6 +662,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.
>           */
> 

Cliff,

I'll hold onto this pending Atsushi's acceptance of the makedumpfile patch.

Thanks,
  Dave




More information about the Crash-utility mailing list