Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <kirill.shutemov@linux.intel.com>
Cc: Jonas Bonn <jonas@southpole.se>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Kirill A. Shutemov and committed by
Linus Torvalds
b3d59c6e 0470d4aa

+8 -2
+8 -2
arch/openrisc/include/asm/pgalloc.h
··· 78 78 { 79 79 struct page *pte; 80 80 pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT, 0); 81 - if (pte) 82 - clear_page(page_address(pte)); 81 + if (!pte) 82 + return NULL; 83 + clear_page(page_address(pte)); 84 + if (!pgtable_page_ctor(pte)) { 85 + __free_page(pte); 86 + return NULL; 87 + } 83 88 return pte; 84 89 } 85 90 ··· 95 90 96 91 static inline void pte_free(struct mm_struct *mm, struct page *pte) 97 92 { 93 + pgtable_page_dtor(pte); 98 94 __free_page(pte); 99 95 } 100 96