[PATCH v5 8/8] add a new interface to show the memory usage of 1st kernel

Vivek Goyal vgoyal at redhat.com
Mon Aug 25 13:04:18 PDT 2014


On Mon, Aug 25, 2014 at 02:36:22PM +0800, Baoquan He wrote:
> Recently people complained that they don't know how to decide how
> much disk size need be reserved for kdump. E.g there are lots of
> machines with different memory size, if the memory usage information
> of current system can be shown, that can help them to make an estimate
> how much storage space need be reserved.
> 
> In this patch, a new interface is added into makedumpfile. By the
> help of this, people can know the page number of memory in different
> use. The implementation is analyzing the "System Ram" and "kernel text"
> program segment of /proc/kcore excluding the crashkernel range, then
> calculating the page number of different kind per vmcoreinfo.
> 
> The print is like below:
> 
> ~$ ./makedumpfile --mem-usage /proc/kcore
> The kernel version is not supported.
> The created dumpfile may be incomplete.

I still think that above messages should go. It does not make
any sense with --mem-usage. No dumpfile is being created here.

> Excluding unnecessary pages        : [100.0 %] |


> 
> Page number of memory in different use
> --------------------------------------------------

I think above header can completely go away.  It kind of looks odd.

> TYPE		PAGES			EXCLUDABLE	DESCRIPTION
> ZERO		29149           	yes		Pages filled with zero
> CACHE		171288          	yes		Cache pages
> CACHE_PRIVATE	12051           	yes		Cache pages + private
> USER		31816           	yes		User process pages
> FREE		3700059         	yes		Free pages
> KERN_DATA	105305          	no		Dumpable kernel data 
> 
> Total pages on system:	4049668         
> 
> Showing page number of memory in different use successfully.

I think we don't need above line. I am not even sure what does it mean.
> 
> makedumpfile Completed.

We don't need above line either.

In output we should just show the actual table. If there is an error, 
we should output error and exit (no table).

Thanks
Vivek



More information about the kexec mailing list