Commit ee8f248d266ec6966c0ce6b7dec24de43dcc1b58
Committed by
Linus Torvalds
1 parent
2b37c35e65
Exists in
master
and in
6 other branches
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>
Showing 2 changed files with 12 additions and 1 deletions Side-by-side Diff
include/linux/hugetlb.h
mm/hugetlb.c
... | ... | @@ -1105,8 +1105,16 @@ |
1105 | 1105 | struct huge_bootmem_page *m; |
1106 | 1106 | |
1107 | 1107 | list_for_each_entry(m, &huge_boot_pages, list) { |
1108 | - struct page *page = virt_to_page(m); | |
1109 | 1108 | struct hstate *h = m->hstate; |
1109 | + struct page *page; | |
1110 | + | |
1111 | +#ifdef CONFIG_HIGHMEM | |
1112 | + page = pfn_to_page(m->phys >> PAGE_SHIFT); | |
1113 | + free_bootmem_late((unsigned long)m, | |
1114 | + sizeof(struct huge_bootmem_page)); | |
1115 | +#else | |
1116 | + page = virt_to_page(m); | |
1117 | +#endif | |
1110 | 1118 | __ClearPageReserved(page); |
1111 | 1119 | WARN_ON(page_count(page) != 1); |
1112 | 1120 | prep_compound_huge_page(page, h->order); |