diff options
Diffstat (limited to 'arch/powerpc/mm/init_64.c')
-rw-r--r-- | arch/powerpc/mm/init_64.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c index aa98b79e734c..ce974c83d88a 100644 --- a/arch/powerpc/mm/init_64.c +++ b/arch/powerpc/mm/init_64.c | |||
@@ -187,12 +187,21 @@ static void zero_ctor(void *addr, kmem_cache_t *cache, unsigned long flags) | |||
187 | memset(addr, 0, kmem_cache_size(cache)); | 187 | memset(addr, 0, kmem_cache_size(cache)); |
188 | } | 188 | } |
189 | 189 | ||
190 | #ifdef CONFIG_PPC_64K_PAGES | ||
191 | static const int pgtable_cache_size[2] = { | ||
192 | PTE_TABLE_SIZE, PGD_TABLE_SIZE | ||
193 | }; | ||
194 | static const char *pgtable_cache_name[ARRAY_SIZE(pgtable_cache_size)] = { | ||
195 | "pte_pmd_cache", "pgd_cache", | ||
196 | }; | ||
197 | #else | ||
190 | static const int pgtable_cache_size[2] = { | 198 | static const int pgtable_cache_size[2] = { |
191 | PTE_TABLE_SIZE, PMD_TABLE_SIZE | 199 | PTE_TABLE_SIZE, PMD_TABLE_SIZE |
192 | }; | 200 | }; |
193 | static const char *pgtable_cache_name[ARRAY_SIZE(pgtable_cache_size)] = { | 201 | static const char *pgtable_cache_name[ARRAY_SIZE(pgtable_cache_size)] = { |
194 | "pgd_pte_cache", "pud_pmd_cache", | 202 | "pgd_pte_cache", "pud_pmd_cache", |
195 | }; | 203 | }; |
204 | #endif /* CONFIG_PPC_64K_PAGES */ | ||
196 | 205 | ||
197 | kmem_cache_t *pgtable_cache[ARRAY_SIZE(pgtable_cache_size)]; | 206 | kmem_cache_t *pgtable_cache[ARRAY_SIZE(pgtable_cache_size)]; |
198 | 207 | ||
@@ -200,19 +209,14 @@ void pgtable_cache_init(void) | |||
200 | { | 209 | { |
201 | int i; | 210 | int i; |
202 | 211 | ||
203 | BUILD_BUG_ON(PTE_TABLE_SIZE != pgtable_cache_size[PTE_CACHE_NUM]); | ||
204 | BUILD_BUG_ON(PMD_TABLE_SIZE != pgtable_cache_size[PMD_CACHE_NUM]); | ||
205 | BUILD_BUG_ON(PUD_TABLE_SIZE != pgtable_cache_size[PUD_CACHE_NUM]); | ||
206 | BUILD_BUG_ON(PGD_TABLE_SIZE != pgtable_cache_size[PGD_CACHE_NUM]); | ||
207 | |||
208 | for (i = 0; i < ARRAY_SIZE(pgtable_cache_size); i++) { | 212 | for (i = 0; i < ARRAY_SIZE(pgtable_cache_size); i++) { |
209 | int size = pgtable_cache_size[i]; | 213 | int size = pgtable_cache_size[i]; |
210 | const char *name = pgtable_cache_name[i]; | 214 | const char *name = pgtable_cache_name[i]; |
211 | 215 | ||
212 | pgtable_cache[i] = kmem_cache_create(name, | 216 | pgtable_cache[i] = kmem_cache_create(name, |
213 | size, size, | 217 | size, size, |
214 | SLAB_HWCACHE_ALIGN | 218 | SLAB_HWCACHE_ALIGN | |
215 | | SLAB_MUST_HWCACHE_ALIGN, | 219 | SLAB_MUST_HWCACHE_ALIGN, |
216 | zero_ctor, | 220 | zero_ctor, |
217 | NULL); | 221 | NULL); |
218 | if (! pgtable_cache[i]) | 222 | if (! pgtable_cache[i]) |