diff options
| -rw-r--r-- | arch/powerpc/mm/init_64.c | 18 | ||||
| -rw-r--r-- | include/asm-ppc64/pgalloc.h | 4 |
2 files changed, 16 insertions, 6 deletions
diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c index ce974c83d88a..e274cf10205c 100644 --- a/arch/powerpc/mm/init_64.c +++ b/arch/powerpc/mm/init_64.c | |||
| @@ -20,6 +20,8 @@ | |||
| 20 | * | 20 | * |
| 21 | */ | 21 | */ |
| 22 | 22 | ||
| 23 | #undef DEBUG | ||
| 24 | |||
| 23 | #include <linux/config.h> | 25 | #include <linux/config.h> |
| 24 | #include <linux/signal.h> | 26 | #include <linux/signal.h> |
| 25 | #include <linux/sched.h> | 27 | #include <linux/sched.h> |
| @@ -64,6 +66,12 @@ | |||
| 64 | #include <asm/vdso.h> | 66 | #include <asm/vdso.h> |
| 65 | #include <asm/imalloc.h> | 67 | #include <asm/imalloc.h> |
| 66 | 68 | ||
| 69 | #ifdef DEBUG | ||
| 70 | #define DBG(fmt...) printk(fmt) | ||
| 71 | #else | ||
| 72 | #define DBG(fmt...) | ||
| 73 | #endif | ||
| 74 | |||
| 67 | #if PGTABLE_RANGE > USER_VSID_RANGE | 75 | #if PGTABLE_RANGE > USER_VSID_RANGE |
| 68 | #warning Limited user VSID range means pagetable space is wasted | 76 | #warning Limited user VSID range means pagetable space is wasted |
| 69 | #endif | 77 | #endif |
| @@ -188,14 +196,14 @@ static void zero_ctor(void *addr, kmem_cache_t *cache, unsigned long flags) | |||
| 188 | } | 196 | } |
| 189 | 197 | ||
| 190 | #ifdef CONFIG_PPC_64K_PAGES | 198 | #ifdef CONFIG_PPC_64K_PAGES |
| 191 | static const int pgtable_cache_size[2] = { | 199 | static const unsigned int pgtable_cache_size[3] = { |
| 192 | PTE_TABLE_SIZE, PGD_TABLE_SIZE | 200 | PTE_TABLE_SIZE, PMD_TABLE_SIZE, PGD_TABLE_SIZE |
| 193 | }; | 201 | }; |
| 194 | static const char *pgtable_cache_name[ARRAY_SIZE(pgtable_cache_size)] = { | 202 | static const char *pgtable_cache_name[ARRAY_SIZE(pgtable_cache_size)] = { |
| 195 | "pte_pmd_cache", "pgd_cache", | 203 | "pte_pmd_cache", "pmd_cache", "pgd_cache", |
| 196 | }; | 204 | }; |
| 197 | #else | 205 | #else |
| 198 | static const int pgtable_cache_size[2] = { | 206 | static const unsigned int pgtable_cache_size[2] = { |
| 199 | PTE_TABLE_SIZE, PMD_TABLE_SIZE | 207 | PTE_TABLE_SIZE, PMD_TABLE_SIZE |
| 200 | }; | 208 | }; |
| 201 | static const char *pgtable_cache_name[ARRAY_SIZE(pgtable_cache_size)] = { | 209 | static const char *pgtable_cache_name[ARRAY_SIZE(pgtable_cache_size)] = { |
| @@ -213,6 +221,8 @@ void pgtable_cache_init(void) | |||
| 213 | int size = pgtable_cache_size[i]; | 221 | int size = pgtable_cache_size[i]; |
| 214 | const char *name = pgtable_cache_name[i]; | 222 | const char *name = pgtable_cache_name[i]; |
| 215 | 223 | ||
| 224 | DBG("Allocating page table cache %s (#%d) " | ||
| 225 | "for size: %08x...\n", name, i, size); | ||
| 216 | pgtable_cache[i] = kmem_cache_create(name, | 226 | pgtable_cache[i] = kmem_cache_create(name, |
| 217 | size, size, | 227 | size, size, |
| 218 | SLAB_HWCACHE_ALIGN | | 228 | SLAB_HWCACHE_ALIGN | |
diff --git a/include/asm-ppc64/pgalloc.h b/include/asm-ppc64/pgalloc.h index 98da0e4262bd..dcf3622d1946 100644 --- a/include/asm-ppc64/pgalloc.h +++ b/include/asm-ppc64/pgalloc.h | |||
| @@ -10,8 +10,8 @@ extern kmem_cache_t *pgtable_cache[]; | |||
| 10 | 10 | ||
| 11 | #ifdef CONFIG_PPC_64K_PAGES | 11 | #ifdef CONFIG_PPC_64K_PAGES |
| 12 | #define PTE_CACHE_NUM 0 | 12 | #define PTE_CACHE_NUM 0 |
| 13 | #define PMD_CACHE_NUM 0 | 13 | #define PMD_CACHE_NUM 1 |
| 14 | #define PGD_CACHE_NUM 1 | 14 | #define PGD_CACHE_NUM 2 |
| 15 | #else | 15 | #else |
| 16 | #define PTE_CACHE_NUM 0 | 16 | #define PTE_CACHE_NUM 0 |
| 17 | #define PMD_CACHE_NUM 1 | 17 | #define PMD_CACHE_NUM 1 |
