linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hugetlb: /proc/meminfo shows data for all sizes of hugepages
@ 2011-03-07 13:05 Petr Holasek
  2011-03-07 19:46 ` Dave Hansen
  2011-03-08  1:26 ` Andi Kleen
  0 siblings, 2 replies; 13+ messages in thread
From: Petr Holasek @ 2011-03-07 13:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: emunson, anton, Petr Holasek, Andi Kleen, Naoya Horiguchi,
	Mel Gorman, Andrew Morton, Wu Fengguang, linux-mm

/proc/meminfo file shows data for all used sizes of hugepages
on system, not only for default hugepage size.

Signed-off-by: Petr Holasek <pholasek@redhat.com>
---
 mm/hugetlb.c |   26 ++++++++++++++------------
 1 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index bb0b7c1..7919849 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -1963,18 +1963,20 @@ out:
 
 void hugetlb_report_meminfo(struct seq_file *m)
 {
-	struct hstate *h = &default_hstate;
-	seq_printf(m,
-			"HugePages_Total:   %5lu\n"
-			"HugePages_Free:    %5lu\n"
-			"HugePages_Rsvd:    %5lu\n"
-			"HugePages_Surp:    %5lu\n"
-			"Hugepagesize:   %8lu kB\n",
-			h->nr_huge_pages,
-			h->free_huge_pages,
-			h->resv_huge_pages,
-			h->surplus_huge_pages,
-			1UL << (huge_page_order(h) + PAGE_SHIFT - 10));
+	struct hstate *h;
+
+	for_each_hstate(h)
+		seq_printf(m,
+				"HugePages_Total:   %5lu\n"
+				"HugePages_Free:    %5lu\n"
+				"HugePages_Rsvd:    %5lu\n"
+				"HugePages_Surp:    %5lu\n"
+				"Hugepagesize:   %8lu kB\n",
+				h->nr_huge_pages,
+				h->free_huge_pages,
+				h->resv_huge_pages,
+				h->surplus_huge_pages,
+				1UL << (huge_page_order(h) + PAGE_SHIFT - 10));
 }
 
 int hugetlb_report_node_meminfo(int nid, char *buf)
-- 
1.7.1

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2011-03-08 13:52 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-07 13:05 [PATCH] hugetlb: /proc/meminfo shows data for all sizes of hugepages Petr Holasek
2011-03-07 19:46 ` Dave Hansen
2011-03-07 20:13   ` Eric B Munson
2011-03-07 22:51   ` Andrew Morton
2011-03-07 23:14     ` Naoya Horiguchi
2011-03-07 23:24       ` Eric B Munson
2011-03-07 23:25       ` Andrew Morton
2011-03-07 23:47         ` David Rientjes
2011-03-08  0:57           ` Nishanth Aravamudan
2011-03-08  9:37             ` Mel Gorman
2011-03-08 11:21         ` Petr Holasek
2011-03-08 13:51           ` Eric B Munson
2011-03-08  1:26 ` Andi Kleen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).