mm: add statistics for PUD level pagetable
[linux-2.6-microblaze.git] / include / asm-generic / pgalloc.h
index c75d4a7..879e5f8 100644 (file)
@@ -169,6 +169,8 @@ static inline pud_t *__pud_alloc_one(struct mm_struct *mm, unsigned long addr)
        ptdesc = pagetable_alloc(gfp, 0);
        if (!ptdesc)
                return NULL;
+
+       pagetable_pud_ctor(ptdesc);
        return ptdesc_address(ptdesc);
 }
 
@@ -190,8 +192,11 @@ static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr)
 
 static inline void __pud_free(struct mm_struct *mm, pud_t *pud)
 {
+       struct ptdesc *ptdesc = virt_to_ptdesc(pud);
+
        BUG_ON((unsigned long)pud & (PAGE_SIZE-1));
-       pagetable_free(virt_to_ptdesc(pud));
+       pagetable_pud_dtor(ptdesc);
+       pagetable_free(ptdesc);
 }
 
 #ifndef __HAVE_ARCH_PUD_FREE