summaryrefslogtreecommitdiff
path: root/mm/hugetlb.c
diff options
context:
space:
mode:
authorAndi Kleen <ak@suse.de>2008-07-24 08:27:49 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-24 21:47:18 +0400
commit4abd32dbab201c3ced0b0af12accea77cd9eeffc (patch)
tree152295359540e704fb1d0a4a0fbf5df889108634 /mm/hugetlb.c
parent8faa8b077b2cdc4e4646842fe50b07840955a013 (diff)
downloadlinux-4abd32dbab201c3ced0b0af12accea77cd9eeffc.tar.xz
hugetlb: printk cleanup
- Reword sentence to clarify meaning with multiple options - Add support for using GB prefixes for the page size - Add extra printk to delayed > MAX_ORDER allocation code Acked-by: Adam Litke <agl@us.ibm.com> Acked-by: Nishanth Aravamudan <nacc@us.ibm.com> Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Nick Piggin <npiggin@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/hugetlb.c')
-rw-r--r--mm/hugetlb.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 243a8684d180..0c74c14dd2f7 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -1006,15 +1006,27 @@ static void __init hugetlb_init_hstates(void)
}
}
+static char * __init memfmt(char *buf, unsigned long n)
+{
+ if (n >= (1UL << 30))
+ sprintf(buf, "%lu GB", n >> 30);
+ else if (n >= (1UL << 20))
+ sprintf(buf, "%lu MB", n >> 20);
+ else
+ sprintf(buf, "%lu KB", n >> 10);
+ return buf;
+}
+
static void __init report_hugepages(void)
{
struct hstate *h;
for_each_hstate(h) {
- printk(KERN_INFO "Total HugeTLB memory allocated, "
- "%ld %dMB pages\n",
- h->free_huge_pages,
- 1 << (h->order + PAGE_SHIFT - 20));
+ char buf[32];
+ printk(KERN_INFO "HugeTLB registered %s page size, "
+ "pre-allocated %ld pages\n",
+ memfmt(buf, huge_page_size(h)),
+ h->free_huge_pages);
}
}