[Crash-utility] [RFC PATCH v3 0/2] Show memory overcommit data in dump_kmeminfo()

Aaron Tomlin atomlin at redhat.com
Mon Dec 8 14:23:00 UTC 2014


The first patch changes dump_kmeminfo() to report overcommit information
similar to that displayed under the proc/meminfo file. It may be useful to
indicate memory over commitment abuse, for example with forced vmcores from
system hangs due to shortage of memory. The intended output is as follows:

  crash> kmem -i
                   PAGES        TOTAL      PERCENTAGE
      TOTAL MEM  1965332       7.5 GB         ----
           FREE    78080       305 MB    3% of TOTAL MEM
           USED  1887252       7.2 GB   96% of TOTAL MEM
         SHARED   789954         3 GB   40% of TOTAL MEM
        BUFFERS   110606     432.1 MB    5% of TOTAL MEM
         CACHED  1212645       4.6 GB   61% of TOTAL MEM
           SLAB   146563     572.5 MB    7% of TOTAL MEM

     TOTAL SWAP  1970175       7.5 GB         ----
      SWAP USED        5        20 KB    0% of TOTAL SWAP
      SWAP FREE  1970170       7.5 GB   99% of TOTAL SWAP

   COMMIT LIMIT  2952841      11.3 GB         ----
      COMMITTED  1150595       4.4 GB   38% of TOTAL LIMIT

The second patch simply removes the mention of dump_zone_page_usage()
availability from kmem's help page.

Tested under 3.16.4-200.fc20.x86_64 only.
Though this should work under RHEL4 (2.6.9-5) and above whereby the
kernel symbol sysctl_overcommit_memory is available.

Changelog:

v2 -> v3:

 - Appropriately avoid a divide-by-zero when the "allowed" variable
   is correctly set to 0 (e.g. overcommit_ratio is 0 and swap
   device is off)

 - Initialised the following members of offset_table in vm_init():
   hstate_order, hstate_nr_huge_pages, hstate_free_huge_pages and
   hstate_name

 - percpu_counter_struct_count and atomic_t_counter have
   been added to offset_table and each initialised in kernel_init()


Aaron Tomlin (2):
  kmem: Show memory commitment data in kmem output
  help: Remove mention of dump_zone_page_usage()

 defs.h    |   2 +
 help.c    |  40 +++++++-------
 kernel.c  |  11 ++++
 memory.c  | 181 ++++++++++++++++++++++++++++++++++++++++++++++++++++----------
 symbols.c |   4 ++
 5 files changed, 187 insertions(+), 51 deletions(-)

-- 
1.9.3




More information about the Crash-utility mailing list