aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/include
diff options
context:
space:
mode:
authorMike Rapoport <rppt@linux.ibm.com>2019-07-11 23:58:35 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-07-12 14:05:45 -0400
commitf32848e16939e1407ad3413f7faa3e0a8ad802eb (patch)
treed3d71d2acace8f8ff022cf74b24a075059704ebf /arch/um/include
parentd1b46fe50c8b0e0b4035c48ccd5f655aa7ceea16 (diff)
um: switch to generic version of pte allocation
um 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() and pte_free_kernel() versions are identical to the generic ones and can be simply dropped. Link: http://lkml.kernel.org/r/1557296232-15361-14-git-send-email-rppt@linux.ibm.com Signed-off-by: Mike Rapoport <rppt@linux.ibm.com> Reviewed-by: Anton Ivanov <anton.ivanov@cambridgegreys.com> Acked-by: Anton Ivanov <anton.ivanov@cambridgegreys.com> Cc: Albert Ou <aou@eecs.berkeley.edu> Cc: Anshuman Khandual <anshuman.khandual@arm.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>
Diffstat (limited to 'arch/um/include')
-rw-r--r--arch/um/include/asm/pgalloc.h16
1 files changed, 2 insertions, 14 deletions
diff --git a/arch/um/include/asm/pgalloc.h b/arch/um/include/asm/pgalloc.h
index 99eb5682792a..d7b282e9c4d5 100644
--- a/arch/um/include/asm/pgalloc.h
+++ b/arch/um/include/asm/pgalloc.h
@@ -10,6 +10,8 @@
10 10
11#include <linux/mm.h> 11#include <linux/mm.h>
12 12
13#include <asm-generic/pgalloc.h> /* for pte_{alloc,free}_one */
14
13#define pmd_populate_kernel(mm, pmd, pte) \ 15#define pmd_populate_kernel(mm, pmd, pte) \
14 set_pmd(pmd, __pmd(_PAGE_TABLE + (unsigned long) __pa(pte))) 16 set_pmd(pmd, __pmd(_PAGE_TABLE + (unsigned long) __pa(pte)))
15 17
@@ -25,20 +27,6 @@
25extern pgd_t *pgd_alloc(struct mm_struct *); 27extern pgd_t *pgd_alloc(struct mm_struct *);
26extern void pgd_free(struct mm_struct *mm, pgd_t *pgd); 28extern void pgd_free(struct mm_struct *mm, pgd_t *pgd);
27 29
28extern pte_t *pte_alloc_one_kernel(struct mm_struct *);
29extern pgtable_t pte_alloc_one(struct mm_struct *);
30
31static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
32{
33 free_page((unsigned long) pte);
34}
35
36static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
37{
38 pgtable_page_dtor(pte);
39 __free_page(pte);
40}
41
42#define __pte_free_tlb(tlb,pte, address) \ 30#define __pte_free_tlb(tlb,pte, address) \
43do { \ 31do { \
44 pgtable_page_dtor(pte); \ 32 pgtable_page_dtor(pte); \