diff options
author | Jon Tollefson <kniht@linux.vnet.ibm.com> | 2008-07-24 00:27:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-24 13:47:19 -0400 |
commit | 658013e93eb70494f7300bc90457b09a807232a4 (patch) | |
tree | d03a23ac4fff0b35138b5d8abb761e9fad85b09c /arch/powerpc/mm/hugetlbpage.c | |
parent | ec4b2c0c8312d1118c2acd00c89988ecf955d5cc (diff) |
powerpc: scan device tree for gigantic pages
The 16G huge pages have to be reserved in the HMC prior to boot. The
location of the pages are placed in the device tree. This patch adds code
to scan the device tree during very early boot and save these page
locations until hugetlbfs is ready for them.
Acked-by: Adam Litke <agl@us.ibm.com>
Signed-off-by: Jon Tollefson <kniht@linux.vnet.ibm.com>
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 'arch/powerpc/mm/hugetlbpage.c')
-rw-r--r-- | arch/powerpc/mm/hugetlbpage.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c index 5df82186fc93..e2a650a9e533 100644 --- a/arch/powerpc/mm/hugetlbpage.c +++ b/arch/powerpc/mm/hugetlbpage.c | |||
@@ -110,6 +110,22 @@ pmd_t *hpmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long addr) | |||
110 | } | 110 | } |
111 | #endif | 111 | #endif |
112 | 112 | ||
113 | /* Build list of addresses of gigantic pages. This function is used in early | ||
114 | * boot before the buddy or bootmem allocator is setup. | ||
115 | */ | ||
116 | void add_gpage(unsigned long addr, unsigned long page_size, | ||
117 | unsigned long number_of_pages) | ||
118 | { | ||
119 | if (!addr) | ||
120 | return; | ||
121 | while (number_of_pages > 0) { | ||
122 | gpage_freearray[nr_gpages] = addr; | ||
123 | nr_gpages++; | ||
124 | number_of_pages--; | ||
125 | addr += page_size; | ||
126 | } | ||
127 | } | ||
128 | |||
113 | /* Moves the gigantic page addresses from the temporary list to the | 129 | /* Moves the gigantic page addresses from the temporary list to the |
114 | * huge_boot_pages list. */ | 130 | * huge_boot_pages list. */ |
115 | int alloc_bootmem_huge_page(struct hstate *h) | 131 | int alloc_bootmem_huge_page(struct hstate *h) |