diff options
author | Kirill A. Shutemov <kirill.shutemov@linux.intel.com> | 2013-11-14 17:31:23 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-14 19:32:16 -0500 |
commit | b3d59c6eb49476110b4a76bfbae63daae1cda268 (patch) | |
tree | 1153d439eaed1a7d0a8a993a56ce0800758c1897 | |
parent | 0470d4aa29eb0a49554fe71e986e6d6c38dd85cb (diff) |
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>
-rw-r--r-- | arch/openrisc/include/asm/pgalloc.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/openrisc/include/asm/pgalloc.h b/arch/openrisc/include/asm/pgalloc.h index 05c39ecd2efd..21484e5b9e9a 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, | |||
78 | { | 78 | { |
79 | struct page *pte; | 79 | struct page *pte; |
80 | pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT, 0); | 80 | pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT, 0); |
81 | if (pte) | 81 | if (!pte) |
82 | clear_page(page_address(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 | return pte; | 88 | return pte; |
84 | } | 89 | } |
85 | 90 | ||
@@ -90,6 +95,7 @@ static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) | |||
90 | 95 | ||
91 | static inline void pte_free(struct mm_struct *mm, struct page *pte) | 96 | static inline void pte_free(struct mm_struct *mm, struct page *pte) |
92 | { | 97 | { |
98 | pgtable_page_dtor(pte); | ||
93 | __free_page(pte); | 99 | __free_page(pte); |
94 | } | 100 | } |
95 | 101 | ||