[PATCH 7/7] add a new interface to show the memory usage of 1st kernel
Baoquan He
bhe at redhat.com
Fri Jul 11 00:35:43 PDT 2014
Hi,
In this patch, I set info->dump_level=MAX_DUMP_LEVEL, and
info->flag_cyclic=TRUE; With MAX_DUMP_LEVEL all kinds of memory can be
calculated. And under cyclic mode, function get_num_dumpable_cyclic() is
ready to do the page number calculation of memory in different use.
There's miss in [patch 7/7 v1], please reivew [patch 7/7 v2].
Thanks
Baoquan
On 07/11/14 at 03:16pm, Baoquan He wrote:
> Recently people complained that they don't decide how much disk size
> need be reserved for kdump storing. 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. With 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
> Excluding unnecessary pages : [100.0 %] |
>
> Page number of memory in different use
> --------------------------------------------------
> TYPE PAGES EXCLUDABLE DESCRIPTION
> pfn_zero 0x0000000000000000 yes Pages filled with zero
> pfn_cache 0x000000000002b19f yes Cache pages
> pfn_cache_private 0x0000000000042526 yes Cache pages + private
> pfn_user 0x0000000000026bc3 yes User process data pages
> pfn_free 0x0000000000133f79 yes Free pages
> pfn_hwpoison 0x0000000000000000 yes Hwpoison pages
> pfn_kernel_data 0x000000000001dd56 no Dumpable kernel data
>
> Total pages on system: 0x00000000001e5f57
> Excludable pages: 0x00000000001c8201
> Memory Hole: 0x00000000000386a9
> --------------------------------------------------
More information about the kexec
mailing list