aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/init_32.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/mm/init_32.c')
-rw-r--r--arch/x86/mm/init_32.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
index dda4e83649a0..33d367a3432e 100644
--- a/arch/x86/mm/init_32.c
+++ b/arch/x86/mm/init_32.c
@@ -741,24 +741,12 @@ struct kmem_cache *pmd_cache;
741 741
742void __init pgtable_cache_init(void) 742void __init pgtable_cache_init(void)
743{ 743{
744 size_t pgd_size = PTRS_PER_PGD*sizeof(pgd_t); 744 if (PTRS_PER_PMD > 1)
745
746 if (PTRS_PER_PMD > 1) {
747 pmd_cache = kmem_cache_create("pmd", 745 pmd_cache = kmem_cache_create("pmd",
748 PTRS_PER_PMD*sizeof(pmd_t), 746 PTRS_PER_PMD*sizeof(pmd_t),
749 PTRS_PER_PMD*sizeof(pmd_t), 747 PTRS_PER_PMD*sizeof(pmd_t),
750 SLAB_PANIC, 748 SLAB_PANIC,
751 pmd_ctor); 749 pmd_ctor);
752 if (!SHARED_KERNEL_PMD) {
753 /* If we're in PAE mode and have a non-shared
754 kernel pmd, then the pgd size must be a
755 page size. This is because the pgd_list
756 links through the page structure, so there
757 can only be one pgd per page for this to
758 work. */
759 pgd_size = PAGE_SIZE;
760 }
761 }
762} 750}
763 751
764/* 752/*