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

mn10300: 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>
Acked-by: David Howells <dhowells@redhat.com>
Cc: Koichi Yasutake <yasutake.koichi@jp.panasonic.com>
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
0470d4aa 8abe7346

+8 -2
+1
arch/mn10300/include/asm/pgalloc.h
··· 46 46 47 47 static inline void pte_free(struct mm_struct *mm, struct page *pte) 48 48 { 49 + pgtable_page_dtor(pte); 49 50 __free_page(pte); 50 51 } 51 52
+7 -2
arch/mn10300/mm/pgtable.c
··· 78 78 #else 79 79 pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT, 0); 80 80 #endif 81 - if (pte) 82 - clear_highpage(pte); 81 + if (!pte) 82 + return NULL; 83 + clear_highpage(pte); 84 + if (!pgtable_page_ctor(pte)) { 85 + __free_page(pte); 86 + return NULL; 87 + } 83 88 return pte; 84 89 } 85 90