summaryrefslogtreecommitdiffstats
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
authorDavid Rientjes <rientjes@google.com>2013-04-29 18:07:48 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-29 18:54:35 -0400
commit949f7ec5760b021da3cccc1eaeb0671270e4238f (patch)
tree8610da7dff952d64cc59e8a922aa16fb430dd66e /mm/page_alloc.c
parent1444f92c84984dd13f3e8e121115783ae5b22c55 (diff)
mm, hugetlb: include hugepages in meminfo
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: David Rientjes <rientjes@google.com> Acked-by: Michal Hocko <mhocko@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r--mm/page_alloc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 72da11c6804d..7350986bbf99 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -58,6 +58,7 @@
58#include <linux/prefetch.h> 58#include <linux/prefetch.h>
59#include <linux/migrate.h> 59#include <linux/migrate.h>
60#include <linux/page-debug-flags.h> 60#include <linux/page-debug-flags.h>
61#include <linux/hugetlb.h>
61#include <linux/sched/rt.h> 62#include <linux/sched/rt.h>
62 63
63#include <asm/tlbflush.h> 64#include <asm/tlbflush.h>
@@ -3113,6 +3114,8 @@ void show_free_areas(unsigned int filter)
3113 printk("= %lukB\n", K(total)); 3114 printk("= %lukB\n", K(total));
3114 } 3115 }
3115 3116
3117 hugetlb_show_meminfo();
3118
3116 printk("%ld total pagecache pages\n", global_page_state(NR_FILE_PAGES)); 3119 printk("%ld total pagecache pages\n", global_page_state(NR_FILE_PAGES));
3117 3120
3118 show_swap_cache_info(); 3121 show_swap_cache_info();