Skip to content

Commit 0470d4a

Browse files
kiryltorvalds
authored andcommitted
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>
1 parent 8abe734 commit 0470d4a

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

‎arch/mn10300/include/asm/pgalloc.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
4646

4747
static inline void pte_free(struct mm_struct *mm, struct page *pte)
4848
{
49+
pgtable_page_dtor(pte);
4950
__free_page(pte);
5051
}
5152

‎arch/mn10300/mm/pgtable.c‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,13 @@ struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address)
7878
#else
7979
pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT, 0);
8080
#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+
}
8388
return pte;
8489
}
8590

0 commit comments

Comments
 (0)