• David Rientjes's avatar
    mm, hugetlb: include hugepages in meminfo · 949f7ec5
    David Rientjes authored
    Particularly in oom conditions, it's troublesome that hugetlb memory is
    not displayed.  All other meminfo that is emitted will not add up to
    what is expected, and there is no artifact left in the kernel log to
    show that a potentially significant amount of memory is actually
    allocated as hugepages which are not available to be reclaimed.
    
    Booting with hugepages=8192 on the command line, this memory is now
    shown in oom conditions.  For example, with echo m >
    /proc/sysrq-trigger:
    
      Node 0 hugepages_total=2048 hugepages_free=2048 hugepages_surp=0 hugepages_size=2048kB
      Node 1 hugepages_total=2048 hugepages_free=2048 hugepages_surp=0 hugepages_size=2048kB
      Node 2 hugepages_total=2048 hugepages_free=2048 hugepages_surp=0 hugepages_size=2048kB
      Node 3 hugepages_total=2048 hugepages_free=2048 hugepages_surp=0 hugepages_size=2048kB
    
    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: default avatarDavid Rientjes <rientjes@google.com>
    Acked-by: default avatarMichal Hocko <mhocko@suse.cz>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    949f7ec5
hugetlb.c 83.4 KB