hexagon: switch to generic version of pte allocation

The hexagon implementation pte_alloc_one(), pte_alloc_one_kernel(),
pte_free_kernel() and pte_free() is identical to the generic except of
lack of __GFP_ACCOUNT for the user PTEs allocation.

Switch hexagon to use generic version of these functions.

Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by Mike Rapoport and committed by Linus Torvalds 618381f0 bec5545e

Changed files
+2 -32
arch
hexagon
include
asm
+2 -32
arch/hexagon/include/asm/pgalloc.h
··· 11 11 #include <asm/mem-layout.h> 12 12 #include <asm/atomic.h> 13 13 14 + #include <asm-generic/pgalloc.h> /* for pte_{alloc,free}_one */ 15 + 14 16 #define check_pgt_cache() do {} while (0) 15 17 16 18 extern unsigned long long kmap_generation; ··· 46 44 static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) 47 45 { 48 46 free_page((unsigned long) pgd); 49 - } 50 - 51 - static inline struct page *pte_alloc_one(struct mm_struct *mm) 52 - { 53 - struct page *pte; 54 - 55 - pte = alloc_page(GFP_KERNEL | __GFP_ZERO); 56 - if (!pte) 57 - return NULL; 58 - if (!pgtable_page_ctor(pte)) { 59 - __free_page(pte); 60 - return NULL; 61 - } 62 - return pte; 63 - } 64 - 65 - /* _kernel variant gets to use a different allocator */ 66 - static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm) 67 - { 68 - gfp_t flags = GFP_KERNEL | __GFP_ZERO; 69 - return (pte_t *) __get_free_page(flags); 70 - } 71 - 72 - static inline void pte_free(struct mm_struct *mm, struct page *pte) 73 - { 74 - pgtable_page_dtor(pte); 75 - __free_page(pte); 76 - } 77 - 78 - static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) 79 - { 80 - free_page((unsigned long)pte); 81 47 } 82 48 83 49 static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd,