summaryrefslogtreecommitdiff
path: root/mm/hugetlb.c
diff options
context:
space:
mode:
authorBecky Bruce <beckyb@kernel.crashing.org>2011-07-26 04:11:50 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-07-26 07:57:07 +0400
commitee8f248d266ec6966c0ce6b7dec24de43dcc1b58 (patch)
treeca81ada1dc1b46b9fb066331c599d48db4532b39 /mm/hugetlb.c
parent2b37c35e6552b0d04d5db9728bc7af22d53f731a (diff)
downloadlinux-ee8f248d266ec6966c0ce6b7dec24de43dcc1b58.tar.xz
hugetlb: add phys addr to struct huge_bootmem_page
This is needed on HIGHMEM systems - we don't always have a virtual address so store the physical address and map it in as needed. [akpm@linux-foundation.org: cleanup] Signed-off-by: Becky Bruce <beckyb@kernel.crashing.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> 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.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index bfcf153bc829..c6d342d313c7 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -1105,8 +1105,16 @@ static void __init gather_bootmem_prealloc(void)
struct huge_bootmem_page *m;
list_for_each_entry(m, &huge_boot_pages, list) {
- struct page *page = virt_to_page(m);
struct hstate *h = m->hstate;
+ struct page *page;
+
+#ifdef CONFIG_HIGHMEM
+ page = pfn_to_page(m->phys >> PAGE_SHIFT);
+ free_bootmem_late((unsigned long)m,
+ sizeof(struct huge_bootmem_page));
+#else
+ page = virt_to_page(m);
+#endif
__ClearPageReserved(page);
WARN_ON(page_count(page) != 1);
prep_compound_huge_page(page, h->order);