diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/hugetlb.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 0a0be33bb199..ca9a7c6d7e97 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c | |||
@@ -2124,8 +2124,12 @@ int hugetlb_report_node_meminfo(int nid, char *buf) | |||
2124 | /* Return the number pages of memory we physically have, in PAGE_SIZE units. */ | 2124 | /* Return the number pages of memory we physically have, in PAGE_SIZE units. */ |
2125 | unsigned long hugetlb_total_pages(void) | 2125 | unsigned long hugetlb_total_pages(void) |
2126 | { | 2126 | { |
2127 | struct hstate *h = &default_hstate; | 2127 | struct hstate *h; |
2128 | return h->nr_huge_pages * pages_per_huge_page(h); | 2128 | unsigned long nr_total_pages = 0; |
2129 | |||
2130 | for_each_hstate(h) | ||
2131 | nr_total_pages += h->nr_huge_pages * pages_per_huge_page(h); | ||
2132 | return nr_total_pages; | ||
2129 | } | 2133 | } |
2130 | 2134 | ||
2131 | static int hugetlb_acct_memory(struct hstate *h, long delta) | 2135 | static int hugetlb_acct_memory(struct hstate *h, long delta) |