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

microblaze: 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: Michal Simek <monstr@monstr.eu>
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
8abe7346 390f44e2

+9 -3
+9 -3
arch/microblaze/include/asm/pgalloc.h
··· 122 122 #endif 123 123 124 124 ptepage = alloc_pages(flags, 0); 125 - if (ptepage) 126 - clear_highpage(ptepage); 125 + if (!ptepage) 126 + return NULL; 127 + clear_highpage(ptepage); 128 + if (!pgtable_page_ctor(ptepage)) { 129 + __free_page(ptepage); 130 + return NULL; 131 + } 127 132 return ptepage; 128 133 } 129 134 ··· 163 158 __free_page(ptepage); 164 159 } 165 160 166 - extern inline void pte_free(struct mm_struct *mm, struct page *ptepage) 161 + static inline void pte_free(struct mm_struct *mm, struct page *ptepage) 167 162 { 163 + pgtable_page_dtor(ptepage); 168 164 __free_page(ptepage); 169 165 } 170 166