Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 105309
b: refs/heads/master
c: 4abd32d
h: refs/heads/master
i:
  105307: fd01ac1
v: v3
  • Loading branch information
Andi Kleen authored and Linus Torvalds committed Jul 24, 2008
1 parent 7db2b46 commit 06e3d34
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8faa8b077b2cdc4e4646842fe50b07840955a013
refs/heads/master: 4abd32dbab201c3ced0b0af12accea77cd9eeffc
20 changes: 16 additions & 4 deletions trunk/mm/hugetlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 06e3d34

Please sign in to comment.