ubc: fix batched page tables accounting for x86 From: Konstantin Khlebnikov On x86 kernel didn`t use all paging layers. All "++" are already under corresponding macro checks. i386 use only 2 layers of paging i386-pae and i386-ent use 3 layers, but allocate pmd together with pgd. fix for diff-ubc-batch-page-tables-kmem-acct Signed-off-by: Konstantin Khlebnikov --- mm/memory.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index 45ca938..48d03d5 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -176,7 +176,11 @@ static inline void free_pmd_range(struct mmu_gather *tlb, pud_t *pud, pmd = pmd_offset(pud, start); pud_clear(pud); pmd_free_tlb(tlb, pmd); +#ifndef __PAGETABLE_PMD_FOLDED +# ifndef CONFIG_X86_PAE tlb->mm->page_table_acct--; +# endif +#endif } static inline void free_pud_range(struct mmu_gather *tlb, pgd_t *pgd, @@ -210,7 +214,9 @@ static inline void free_pud_range(struct mmu_gather *tlb, pgd_t *pgd, pud = pud_offset(pgd, start); pgd_clear(pgd); pud_free_tlb(tlb, pud); +#ifndef __PAGETABLE_PUD_FOLDED tlb->mm->page_table_acct--; +#endif } /*