History

mm: add missing __PAGETABLE_{PUD,PMD}_FOLDED defines

Core mm expects __PAGETABLE_{PUD,PMD}_FOLDED to be defined if these page table levels folded. Usually, these defines are provided by <asm-generic/pgtable-nopmd.h> and <asm-generic/pgtable-nopud.h>. But some architectures fold page table levels in a custom way. They need to define these macros themself. This patch adds missing defines. The patch fixes mm->nr_pmds underflow and eliminates dead __pmd_alloc() and __pud_alloc() on architectures without these page table levels.

Kirill A. Shutemov committed 11 years ago

Commit c07af4f1 parent cc873176 files · +10 −0Browse files

Unified · Split

6 files
  1. arch/frv/include/asm/pgtable.h +2 −0
  2. arch/m32r/include/asm/pgtable-2level.h +1 −0
  3. arch/m68k/include/asm/pgtable_mm.h +2 −0
  4. arch/mn10300/include/asm/pgtable.h +2 −0
  5. arch/parisc/include/asm/pgtable.h +1 −0
  6. arch/s390/include/asm/pgtable.h +2 −0
arch/frv/include/asm/pgtable.h+2−0
@@ -123,12 +123,14 @@ extern unsigned long empty_zero_page; · 122 unmodified lines
123123 #define PGDIR_MASK (~(PGDIR_SIZE - 1))
124124 #define PTRS_PER_PGD 64
125125
126+#define __PAGETABLE_PUD_FOLDED
126127 #define PUD_SHIFT 26
127128 #define PTRS_PER_PUD 1
128129 #define PUD_SIZE (1UL << PUD_SHIFT)
129130 #define PUD_MASK (~(PUD_SIZE - 1))
130131 #define PUE_SIZE 256
131132
133+#define __PAGETABLE_PMD_FOLDED
132134 #define PMD_SHIFT 26
133135 #define PMD_SIZE (1UL << PMD_SHIFT)
134136 #define PMD_MASK (~(PMD_SIZE - 1))
arch/m32r/include/asm/pgtable-2level.h+1−0
@@ -13,6 +13,7 @@ · 12 unmodified lines
1313 * the M32R is two-level, so we don't really have any
1414 * PMD directory physically.
1515 */
16+#define __PAGETABLE_PMD_FOLDED
1617 #define PMD_SHIFT 22
1718 #define PTRS_PER_PMD 1
1819
arch/m68k/include/asm/pgtable_mm.h+2−0
@@ -54,10 +54,12 @@ · 53 unmodified lines
5454 */
5555 #ifdef CONFIG_SUN3
5656 #define PTRS_PER_PTE 16
57+#define __PAGETABLE_PMD_FOLDED
5758 #define PTRS_PER_PMD 1
5859 #define PTRS_PER_PGD 2048
5960 #elif defined(CONFIG_COLDFIRE)
6061 #define PTRS_PER_PTE 512
62+#define __PAGETABLE_PMD_FOLDED
6163 #define PTRS_PER_PMD 1
6264 #define PTRS_PER_PGD 1024
6365 #else
arch/mn10300/include/asm/pgtable.h+2−0
@@ -56,7 +56,9 @@ extern void paging_init(void); · 55 unmodified lines
5656 #define PGDIR_SHIFT 22
5757 #define PTRS_PER_PGD 1024
5858 #define PTRS_PER_PUD 1 /* we don't really have any PUD physically */
59+#define __PAGETABLE_PUD_FOLDED
5960 #define PTRS_PER_PMD 1 /* we don't really have any PMD physically */
61+#define __PAGETABLE_PMD_FOLDED
6062 #define PTRS_PER_PTE 1024
6163
6264 #define PGD_SIZE PAGE_SIZE
arch/parisc/include/asm/pgtable.h+1−0
@@ -96,6 +96,7 @@ extern void purge_tlb_entries(struct mm_struct *, unsigned long); · 95 unmodified lines
9696 #if PT_NLEVELS == 3
9797 #define BITS_PER_PMD (PAGE_SHIFT + PMD_ORDER - BITS_PER_PMD_ENTRY)
9898 #else
99+#define __PAGETABLE_PMD_FOLDED
99100 #define BITS_PER_PMD 0
100101 #endif
101102 #define PTRS_PER_PMD (1UL << BITS_PER_PMD)
arch/s390/include/asm/pgtable.h+2−0
@@ -91,7 +91,9 @@ extern unsigned long zero_page_mask; · 90 unmodified lines
9191 */
9292 #define PTRS_PER_PTE 256
9393 #ifndef CONFIG_64BIT
94+#define __PAGETABLE_PUD_FOLDED
9495 #define PTRS_PER_PMD 1
96+#define __PAGETABLE_PMD_FOLDED
9597 #define PTRS_PER_PUD 1
9698 #else /* CONFIG_64BIT */
9799 #define PTRS_PER_PMD 2048