aboutsummaryrefslogtreecommitdiffstats
path: root/include
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 /include
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 'include')
-rw-r--r--include/linux/hugetlb.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 16e4e9a643fb..3a62df310f2e 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -58,6 +58,7 @@ void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct *vma,
58int hugetlb_prefault(struct address_space *, struct vm_area_struct *); 58int hugetlb_prefault(struct address_space *, struct vm_area_struct *);
59void hugetlb_report_meminfo(struct seq_file *); 59void hugetlb_report_meminfo(struct seq_file *);
60int hugetlb_report_node_meminfo(int, char *); 60int hugetlb_report_node_meminfo(int, char *);
61void hugetlb_show_meminfo(void);
61unsigned long hugetlb_total_pages(void); 62unsigned long hugetlb_total_pages(void);
62int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, 63int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
63 unsigned long address, unsigned int flags); 64 unsigned long address, unsigned int flags);
@@ -114,6 +115,9 @@ static inline void hugetlb_report_meminfo(struct seq_file *m)
114{ 115{
115} 116}
116#define hugetlb_report_node_meminfo(n, buf) 0 117#define hugetlb_report_node_meminfo(n, buf) 0
118static inline void hugetlb_show_meminfo(void)
119{
120}
117#define follow_huge_pmd(mm, addr, pmd, write) NULL 121#define follow_huge_pmd(mm, addr, pmd, write) NULL
118#define follow_huge_pud(mm, addr, pud, write) NULL 122#define follow_huge_pud(mm, addr, pud, write) NULL
119#define prepare_hugepage_range(file, addr, len) (-EINVAL) 123#define prepare_hugepage_range(file, addr, len) (-EINVAL)