Skip to content

Commit 3f4a130

Browse files
rppttorvalds
authored andcommitted
parisc: switch to generic version of pte allocation
parisc allocates PTE pages with __get_free_page() and uses GFP_KERNEL | __GFP_ZERO for the allocations. Switch it to the generic version that does exactly the same thing for the kernel page tables and adds __GFP_ACCOUNT for the user PTEs. The pte_free_kernel() and pte_free() versions on are identical to the generic ones and can be simply dropped. Link: http://lkml.kernel.org/r/1557296232-15361-12-git-send-email-rppt@linux.ibm.com Signed-off-by: Mike Rapoport <rppt@linux.ibm.com> Cc: Albert Ou <aou@eecs.berkeley.edu> Cc: Anshuman Khandual <anshuman.khandual@arm.com> Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Greentime Hu <green.hu@gmail.com> Cc: Guan Xuetao <gxt@pku.edu.cn> Cc: Guo Ren <guoren@kernel.org> Cc: Guo Ren <ren_guo@c-sky.com> Cc: Helge Deller <deller@gmx.de> Cc: Ley Foon Tan <lftan@altera.com> Cc: Matthew Wilcox <willy@infradead.org> Cc: Matt Turner <mattst88@gmail.com> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Michal Hocko <mhocko@suse.com> Cc: Palmer Dabbelt <palmer@sifive.com> Cc: Paul Burton <paul.burton@mips.com> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Richard Kuo <rkuo@codeaurora.org> Cc: Richard Weinberger <richard@nod.at> Cc: Russell King <linux@armlinux.org.uk> Cc: Sam Creasey <sammy@sammy.net> Cc: Vincent Chen <deanbo422@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent fc7835c commit 3f4a130

1 file changed

Lines changed: 2 additions & 31 deletions

File tree

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

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
#include <asm/cache.h>
1212

13+
#include <asm-generic/pgalloc.h> /* for pte_{alloc,free}_one */
14+
1315
/* Allocate the top level pgd (page directory)
1416
*
1517
* Here (for 64 bit kernels) we implement a Hybrid L2/L3 scheme: we
@@ -122,37 +124,6 @@ pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte)
122124
pmd_populate_kernel(mm, pmd, page_address(pte_page))
123125
#define pmd_pgtable(pmd) pmd_page(pmd)
124126

125-
static inline pgtable_t
126-
pte_alloc_one(struct mm_struct *mm)
127-
{
128-
struct page *page = alloc_page(GFP_KERNEL|__GFP_ZERO);
129-
if (!page)
130-
return NULL;
131-
if (!pgtable_page_ctor(page)) {
132-
__free_page(page);
133-
return NULL;
134-
}
135-
return page;
136-
}
137-
138-
static inline pte_t *
139-
pte_alloc_one_kernel(struct mm_struct *mm)
140-
{
141-
pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_ZERO);
142-
return pte;
143-
}
144-
145-
static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
146-
{
147-
free_page((unsigned long)pte);
148-
}
149-
150-
static inline void pte_free(struct mm_struct *mm, struct page *pte)
151-
{
152-
pgtable_page_dtor(pte);
153-
pte_free_kernel(mm, page_address(pte));
154-
}
155-
156127
#define check_pgt_cache() do { } while (0)
157128

158129
#endif

0 commit comments

Comments
 (0)