Commit beee349e authored by Baoquan He's avatar Baoquan He Committed by Atsushi Kumagai
Browse files

[PATCH v6 8/8] Add a new interface to show the memory usage of 1st kernel.



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 makedumpfile operation may be incomplete.
Excluding unnecessary pages        : [100.0 %] |

----------------------------------------------------------------------
TYPE		PAGES			EXCLUDABLE	DESCRIPTION
ZERO		28823           	yes		Pages filled with zero
CACHE		197932          	yes		Cache pages
CACHE_PRIVATE	15862           	yes		Cache pages + private
USER		30778           	yes		User process pages
FREE		3671105         	yes		Free pages
KERN_DATA	105168          	no		Dumpable kernel data

Total pages on system:	4049668

makedumpfile Completed.

BTW, in formal version of kernel which maintainer declares to support
after sufficient test, the warning message about kernel version won't
occur.

Signed-off-by: default avatarBaoquan He <bhe@redhat.com>
parent fe88093f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment