Commit ee8f248d authored by Becky Bruce's avatar Becky Bruce Committed by Linus Torvalds
Browse files

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.

[ cleanup]
Signed-off-by: default avatarBecky Bruce <>
Cc: Benjamin Herrenschmidt <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 2b37c35e
......@@ -231,6 +231,9 @@ struct hstate {
struct huge_bootmem_page {
struct list_head list;
struct hstate *hstate;
phys_addr_t phys;
struct page *alloc_huge_page_node(struct hstate *h, int nid);
......@@ -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;
page = pfn_to_page(m->phys >> PAGE_SHIFT);
free_bootmem_late((unsigned long)m,
sizeof(struct huge_bootmem_page));
page = virt_to_page(m);
WARN_ON(page_count(page) != 1);
prep_compound_huge_page(page, h->order);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment