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
 }
 
 /*

