diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2006-04-28 01:02:51 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-04-28 01:02:51 -0400 |
commit | f10a04c034c7285a1b15dfa4a83d3e56578e34e8 (patch) | |
tree | ee6bd0c670b6606017cbd88b56a1247ff241e00e /arch/powerpc/mm/init_64.c | |
parent | 37e53db8aa233c65142d63b496277bf5be9c0ade (diff) |
[PATCH] powerpc: Fix pagetable bloat for hugepages
At present, ARCH=powerpc kernels can waste considerable space in
pagetables when making large hugepage mappings. Hugepage PTEs go in
PMD pages, but each PMD page maps 256M and so contains only 16
hugepage PTEs (128 bytes of data), but takes up a 1024 byte
allocation. With CONFIG_PPC_64K_PAGES enabled (64k base page size),
the situation is worse. Now hugepage PTEs are at the PTE page level
(also mapping 256M), so we store 16 hugepage PTEs in a 64k allocation.
The PowerPC MMU already means that any 256M region is either all
hugepage, or all normal pages. Thus, with some care, we can use a
different allocation for the hugepage PTE tables and only allocate the
128 bytes necessary.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/mm/init_64.c')
-rw-r--r-- | arch/powerpc/mm/init_64.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c index babebd15bdc4..9e30f968c184 100644 --- a/arch/powerpc/mm/init_64.c +++ b/arch/powerpc/mm/init_64.c | |||
@@ -162,7 +162,14 @@ static const char *pgtable_cache_name[ARRAY_SIZE(pgtable_cache_size)] = { | |||
162 | }; | 162 | }; |
163 | #endif /* CONFIG_PPC_64K_PAGES */ | 163 | #endif /* CONFIG_PPC_64K_PAGES */ |
164 | 164 | ||
165 | #ifdef CONFIG_HUGETLB_PAGE | ||
166 | /* Hugepages need one extra cache, initialized in hugetlbpage.c. We | ||
167 | * can't put into the tables above, because HPAGE_SHIFT is not compile | ||
168 | * time constant. */ | ||
169 | kmem_cache_t *pgtable_cache[ARRAY_SIZE(pgtable_cache_size)+1]; | ||
170 | #else | ||
165 | kmem_cache_t *pgtable_cache[ARRAY_SIZE(pgtable_cache_size)]; | 171 | kmem_cache_t *pgtable_cache[ARRAY_SIZE(pgtable_cache_size)]; |
172 | #endif | ||
166 | 173 | ||
167 | void pgtable_cache_init(void) | 174 | void pgtable_cache_init(void) |
168 | { | 175 | { |