|
@@ -2124,8 +2124,12 @@ int hugetlb_report_node_meminfo(int nid, char *buf)
|
|
|
/* Return the number pages of memory we physically have, in PAGE_SIZE units. */
|
|
|
unsigned long hugetlb_total_pages(void)
|
|
|
{
|
|
|
- struct hstate *h = &default_hstate;
|
|
|
- return h->nr_huge_pages * pages_per_huge_page(h);
|
|
|
+ struct hstate *h;
|
|
|
+ unsigned long nr_total_pages = 0;
|
|
|
+
|
|
|
+ for_each_hstate(h)
|
|
|
+ nr_total_pages += h->nr_huge_pages * pages_per_huge_page(h);
|
|
|
+ return nr_total_pages;
|
|
|
}
|
|
|
|
|
|
static int hugetlb_acct_memory(struct hstate *h, long delta)
|