[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1557296232-15361-7-git-send-email-rppt@linux.ibm.com>
Date: Wed, 8 May 2019 09:17:03 +0300
From: Mike Rapoport <rppt@...ux.ibm.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Arnd Bergmann <arnd@...db.de>,
Anshuman Khandual <anshuman.khandual@....com>,
Catalin Marinas <catalin.marinas@....com>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Greentime Hu <green.hu@...il.com>,
Guan Xuetao <gxt@....edu.cn>, Guo Ren <guoren@...nel.org>,
Helge Deller <deller@....de>, Ley Foon Tan <lftan@...era.com>,
Matthew Wilcox <willy@...radead.org>,
Matt Turner <mattst88@...il.com>,
Michael Ellerman <mpe@...erman.id.au>,
Michal Hocko <mhocko@...e.com>,
Palmer Dabbelt <palmer@...ive.com>,
Paul Burton <paul.burton@...s.com>,
Richard Kuo <rkuo@...eaurora.org>,
Richard Weinberger <richard@....at>,
Russell King <linux@...linux.org.uk>,
Sam Creasey <sammy@...my.net>, x86@...nel.org,
linux-alpha@...r.kernel.org, linux-arch@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-hexagon@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-m68k@...ts.linux-m68k.org, linux-mips@...r.kernel.org,
linux-mm@...ck.org, linux-parisc@...r.kernel.org,
linuxppc-dev@...ts.ozlabs.org, linux-riscv@...ts.infradead.org,
linux-um@...ts.infradead.org, nios2-dev@...ts.rocketboards.org,
Mike Rapoport <rppt@...ux.ibm.com>
Subject: [PATCH v2 06/14] 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@...ux.ibm.com>
---
arch/hexagon/include/asm/pgalloc.h | 34 ++--------------------------------
1 file changed, 2 insertions(+), 32 deletions(-)
diff --git a/arch/hexagon/include/asm/pgalloc.h b/arch/hexagon/include/asm/pgalloc.h
index d361838..7661a26 100644
--- a/arch/hexagon/include/asm/pgalloc.h
+++ b/arch/hexagon/include/asm/pgalloc.h
@@ -24,6 +24,8 @@
#include <asm/mem-layout.h>
#include <asm/atomic.h>
+#include <asm-generic/pgalloc.h> /* for pte_{alloc,free}_one */
+
#define check_pgt_cache() do {} while (0)
extern unsigned long long kmap_generation;
@@ -59,38 +61,6 @@ static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
free_page((unsigned long) pgd);
}
-static inline struct page *pte_alloc_one(struct mm_struct *mm)
-{
- struct page *pte;
-
- pte = alloc_page(GFP_KERNEL | __GFP_ZERO);
- if (!pte)
- return NULL;
- if (!pgtable_page_ctor(pte)) {
- __free_page(pte);
- return NULL;
- }
- return pte;
-}
-
-/* _kernel variant gets to use a different allocator */
-static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm)
-{
- gfp_t flags = GFP_KERNEL | __GFP_ZERO;
- return (pte_t *) __get_free_page(flags);
-}
-
-static inline void pte_free(struct mm_struct *mm, struct page *pte)
-{
- pgtable_page_dtor(pte);
- __free_page(pte);
-}
-
-static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
-{
- free_page((unsigned long)pte);
-}
-
static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd,
pgtable_t pte)
{
--
2.7.4
Powered by blists - more mailing lists