aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm/init_64.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/mm/init_64.c')
-rw-r--r--arch/powerpc/mm/init_64.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c
index a41bc5aa2043..4f7df85129d8 100644
--- a/arch/powerpc/mm/init_64.c
+++ b/arch/powerpc/mm/init_64.c
@@ -136,9 +136,14 @@ static int __init setup_kcore(void)
136module_init(setup_kcore); 136module_init(setup_kcore);
137#endif 137#endif
138 138
139static void zero_ctor(struct kmem_cache *cache, void *addr) 139static void pgd_ctor(void *addr)
140{ 140{
141 memset(addr, 0, kmem_cache_size(cache)); 141 memset(addr, 0, PGD_TABLE_SIZE);
142}
143
144static void pmd_ctor(void *addr)
145{
146 memset(addr, 0, PMD_TABLE_SIZE);
142} 147}
143 148
144static const unsigned int pgtable_cache_size[2] = { 149static const unsigned int pgtable_cache_size[2] = {
@@ -163,19 +168,8 @@ struct kmem_cache *pgtable_cache[ARRAY_SIZE(pgtable_cache_size)];
163 168
164void pgtable_cache_init(void) 169void pgtable_cache_init(void)
165{ 170{
166 int i; 171 pgtable_cache[0] = kmem_cache_create(pgtable_cache_name[0], PGD_TABLE_SIZE, PGD_TABLE_SIZE, SLAB_PANIC, pgd_ctor);
167 172 pgtable_cache[1] = kmem_cache_create(pgtable_cache_name[1], PMD_TABLE_SIZE, PMD_TABLE_SIZE, SLAB_PANIC, pmd_ctor);
168 for (i = 0; i < ARRAY_SIZE(pgtable_cache_size); i++) {
169 int size = pgtable_cache_size[i];
170 const char *name = pgtable_cache_name[i];
171
172 pr_debug("Allocating page table cache %s (#%d) "
173 "for size: %08x...\n", name, i, size);
174 pgtable_cache[i] = kmem_cache_create(name,
175 size, size,
176 SLAB_PANIC,
177 zero_ctor);
178 }
179} 173}
180 174
181#ifdef CONFIG_SPARSEMEM_VMEMMAP 175#ifdef CONFIG_SPARSEMEM_VMEMMAP