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

opeinrisc: switch to generic version of pte allocation

Replace pte_alloc_one(), pte_free() and pte_free_kernel() with the generic
implementation. The only actual functional change is the addition of
__GFP_ACCOUT for the allocation of the user page tables.

The pte_alloc_one_kernel() is kept back because its implementation on
openrisc is different than the generic one.

Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Pekka Enberg <penberg@kernel.org>
Acked-by: Stafford Horne <shorne@gmail.com>
Cc: Abdul Haleem <abdhalee@linux.vnet.ibm.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: Joerg Roedel <jroedel@suse.de>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Matthew Wilcox <willy@infradead.org>
Link: http://lkml.kernel.org/r/20200627143453.31835-3-rppt@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Mike Rapoport and committed by
Linus Torvalds
fc2a6b83 ca15ca40

+3 -30
+3 -30
arch/openrisc/include/asm/pgalloc.h
··· 20 20 #include <linux/mm.h> 21 21 #include <linux/memblock.h> 22 22 23 + #define __HAVE_ARCH_PTE_ALLOC_ONE_KERNEL 24 + #include <asm-generic/pgalloc.h> 25 + 23 26 extern int mem_init_done; 24 27 25 28 #define pmd_populate_kernel(mm, pmd, pte) \ ··· 64 61 } 65 62 #endif 66 63 67 - static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) 68 - { 69 - free_page((unsigned long)pgd); 70 - } 71 - 72 64 extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm); 73 - 74 - static inline struct page *pte_alloc_one(struct mm_struct *mm) 75 - { 76 - struct page *pte; 77 - pte = alloc_pages(GFP_KERNEL, 0); 78 - if (!pte) 79 - return NULL; 80 - clear_page(page_address(pte)); 81 - if (!pgtable_pte_page_ctor(pte)) { 82 - __free_page(pte); 83 - return NULL; 84 - } 85 - return pte; 86 - } 87 - 88 - static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) 89 - { 90 - free_page((unsigned long)pte); 91 - } 92 - 93 - static inline void pte_free(struct mm_struct *mm, struct page *pte) 94 - { 95 - pgtable_pte_page_dtor(pte); 96 - __free_page(pte); 97 - } 98 65 99 66 #define __pte_free_tlb(tlb, pte, addr) \ 100 67 do { \