aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/hugetlb.h4
-rw-r--r--mm/hugetlb.c15
-rw-r--r--mm/page_alloc.c3
3 files changed, 22 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)
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 73b864a32017..9b9aeef8e590 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -2121,6 +2121,21 @@ int hugetlb_report_node_meminfo(int nid, char *buf)
2121 nid, h->surplus_huge_pages_node[nid]); 2121 nid, h->surplus_huge_pages_node[nid]);
2122} 2122}
2123 2123
2124void hugetlb_show_meminfo(void)
2125{
2126 struct hstate *h;
2127 int nid;
2128
2129 for_each_node_state(nid, N_MEMORY)
2130 for_each_hstate(h)
2131 pr_info("Node %d hugepages_total=%u hugepages_free=%u hugepages_surp=%u hugepages_size=%lukB\n",
2132 nid,
2133 h->nr_huge_pages_node[nid],
2134 h->free_huge_pages_node[nid],
2135 h->surplus_huge_pages_node[nid],
2136 1UL << (huge_page_order(h) + PAGE_SHIFT - 10));
2137}
2138
2124/* Return the number pages of memory we physically have, in PAGE_SIZE units. */ 2139/* Return the number pages of memory we physically have, in PAGE_SIZE units. */
2125unsigned long hugetlb_total_pages(void) 2140unsigned long hugetlb_total_pages(void)
2126{ 2141{
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();