From: Kirill A. Shutemov Date: Thu, 14 Nov 2013 22:31:23 +0000 (-0800) Subject: openrisc: add missing pgtable_page_ctor/dtor calls X-Git-Tag: v3.13-rc1~84^2~51 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b3d59c6eb49476110b4a76bfbae63daae1cda268;p=profile%2Fivi%2Fkernel-x86-ivi.git openrisc: add missing pgtable_page_ctor/dtor calls It will fix NR_PAGETABLE accounting. It's also required if the arch is going ever support split ptl. Signed-off-by: Kirill A. Shutemov Cc: Jonas Bonn Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/arch/openrisc/include/asm/pgalloc.h b/arch/openrisc/include/asm/pgalloc.h index 05c39ec..21484e5 100644 --- a/arch/openrisc/include/asm/pgalloc.h +++ b/arch/openrisc/include/asm/pgalloc.h @@ -78,8 +78,13 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm, { struct page *pte; pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT, 0); - if (pte) - clear_page(page_address(pte)); + if (!pte) + return NULL; + clear_page(page_address(pte)); + if (!pgtable_page_ctor(pte)) { + __free_page(pte); + return NULL; + } return pte; } @@ -90,6 +95,7 @@ static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) static inline void pte_free(struct mm_struct *mm, struct page *pte) { + pgtable_page_dtor(pte); __free_page(pte); }