From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Rapoport Subject: Re: [PATCH 12/15] powerpc/nohash/64: switch to generic version of pte allocation Date: Sun, 5 May 2019 09:23:39 +0300 Message-ID: <20190505062339.GF15755@rapoport-lnx> References: <1556810922-20248-1-git-send-email-rppt@linux.ibm.com> <1556810922-20248-13-git-send-email-rppt@linux.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Christophe Leroy Cc: Andrew Morton , Michal Hocko , Catalin Marinas , Palmer Dabbelt , linux-mips@vger.kernel.org, Guo Ren , linux-hexagon@vger.kernel.org, linux-riscv@lists.infradead.org, linux-arch@vger.kernel.org, Helge Deller , x86@kernel.org, Russell King , Matthew Wilcox , Geert Uytterhoeven , Matt Turner , Sam Creasey , Arnd Bergmann , linux-um@lists.infradead.org, Richard Weinberger , linux-m68k@lists.linux-m68k.org, Greentime Hu , nios2-dev@lists.rocketboards.org, Guan Xuetao , linux-arm-ker List-Id: linux-arch.vger.kernel.org On Thu, May 02, 2019 at 06:56:07PM +0200, Christophe Leroy wrote: > > > Le 02/05/2019 à 17:28, Mike Rapoport a écrit : > >The 64-bit book-E powerpc implements pte_alloc_one(), > >pte_alloc_one_kernel(), pte_free_kernel() and pte_free() the same way as > >the generic version. > > Will soon be converted to the same as the 3 other PPC subarches, see > https://patchwork.ozlabs.org/patch/1091590/ Thanks for the heads up. I'll drop this from the next re-spin. > Christophe > > > > >Switch it to the generic version that does exactly the same thing. > > > >Signed-off-by: Mike Rapoport > >--- > > arch/powerpc/include/asm/nohash/64/pgalloc.h | 35 ++-------------------------- > > 1 file changed, 2 insertions(+), 33 deletions(-) > > > >diff --git a/arch/powerpc/include/asm/nohash/64/pgalloc.h b/arch/powerpc/include/asm/nohash/64/pgalloc.h > >index 66d086f..bfb53a0 100644 > >--- a/arch/powerpc/include/asm/nohash/64/pgalloc.h > >+++ b/arch/powerpc/include/asm/nohash/64/pgalloc.h > >@@ -11,6 +11,8 @@ > > #include > > #include > >+#include /* for pte_{alloc,free}_one */ > >+ > > struct vmemmap_backing { > > struct vmemmap_backing *list; > > unsigned long phys; > >@@ -92,39 +94,6 @@ static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) > > kmem_cache_free(PGT_CACHE(PMD_CACHE_INDEX), pmd); > > } > >- > >-static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm) > >-{ > >- return (pte_t *)__get_free_page(GFP_KERNEL | __GFP_ZERO); > >-} > >- > >-static inline pgtable_t pte_alloc_one(struct mm_struct *mm) > >-{ > >- struct page *page; > >- pte_t *pte; > >- > >- pte = (pte_t *)__get_free_page(GFP_KERNEL | __GFP_ZERO | __GFP_ACCOUNT); > >- if (!pte) > >- return NULL; > >- page = virt_to_page(pte); > >- if (!pgtable_page_ctor(page)) { > >- __free_page(page); > >- return NULL; > >- } > >- return page; > >-} > >- > >-static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) > >-{ > >- free_page((unsigned long)pte); > >-} > >- > >-static inline void pte_free(struct mm_struct *mm, pgtable_t ptepage) > >-{ > >- pgtable_page_dtor(ptepage); > >- __free_page(ptepage); > >-} > >- > > static inline void pgtable_free(void *table, int shift) > > { > > if (!shift) { > > > -- Sincerely yours, Mike. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:42606 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727353AbfEEGXz (ORCPT ); Sun, 5 May 2019 02:23:55 -0400 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x456LQ4E106890 for ; Sun, 5 May 2019 02:23:54 -0400 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0a-001b2d01.pphosted.com with ESMTP id 2s9pe36vdv-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sun, 05 May 2019 02:23:54 -0400 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 5 May 2019 07:23:51 +0100 Date: Sun, 5 May 2019 09:23:39 +0300 From: Mike Rapoport Subject: Re: [PATCH 12/15] powerpc/nohash/64: switch to generic version of pte allocation References: <1556810922-20248-1-git-send-email-rppt@linux.ibm.com> <1556810922-20248-13-git-send-email-rppt@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Message-ID: <20190505062339.GF15755@rapoport-lnx> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Christophe Leroy Cc: Andrew Morton , Michal Hocko , Catalin Marinas , Palmer Dabbelt , linux-mips@vger.kernel.org, Guo Ren , linux-hexagon@vger.kernel.org, linux-riscv@lists.infradead.org, linux-arch@vger.kernel.org, Helge Deller , x86@kernel.org, Russell King , Matthew Wilcox , Geert Uytterhoeven , Matt Turner , Sam Creasey , Arnd Bergmann , linux-um@lists.infradead.org, Richard Weinberger , linux-m68k@lists.linux-m68k.org, Greentime Hu , nios2-dev@lists.rocketboards.org, Guan Xuetao , linux-arm-kernel@lists.infradead.org, linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org, Richard Kuo , Paul Burton , linux-alpha@vger.kernel.org, Ley Foon Tan , linuxppc-dev@lists.ozlabs.org Message-ID: <20190505062339.NHd7GC4vBle-DEhcp__R2liSl1yt50i04qcoyMilTaA@z> On Thu, May 02, 2019 at 06:56:07PM +0200, Christophe Leroy wrote: > > > Le 02/05/2019 à 17:28, Mike Rapoport a écrit : > >The 64-bit book-E powerpc implements pte_alloc_one(), > >pte_alloc_one_kernel(), pte_free_kernel() and pte_free() the same way as > >the generic version. > > Will soon be converted to the same as the 3 other PPC subarches, see > https://patchwork.ozlabs.org/patch/1091590/ Thanks for the heads up. I'll drop this from the next re-spin. > Christophe > > > > >Switch it to the generic version that does exactly the same thing. > > > >Signed-off-by: Mike Rapoport > >--- > > arch/powerpc/include/asm/nohash/64/pgalloc.h | 35 ++-------------------------- > > 1 file changed, 2 insertions(+), 33 deletions(-) > > > >diff --git a/arch/powerpc/include/asm/nohash/64/pgalloc.h b/arch/powerpc/include/asm/nohash/64/pgalloc.h > >index 66d086f..bfb53a0 100644 > >--- a/arch/powerpc/include/asm/nohash/64/pgalloc.h > >+++ b/arch/powerpc/include/asm/nohash/64/pgalloc.h > >@@ -11,6 +11,8 @@ > > #include > > #include > >+#include /* for pte_{alloc,free}_one */ > >+ > > struct vmemmap_backing { > > struct vmemmap_backing *list; > > unsigned long phys; > >@@ -92,39 +94,6 @@ static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) > > kmem_cache_free(PGT_CACHE(PMD_CACHE_INDEX), pmd); > > } > >- > >-static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm) > >-{ > >- return (pte_t *)__get_free_page(GFP_KERNEL | __GFP_ZERO); > >-} > >- > >-static inline pgtable_t pte_alloc_one(struct mm_struct *mm) > >-{ > >- struct page *page; > >- pte_t *pte; > >- > >- pte = (pte_t *)__get_free_page(GFP_KERNEL | __GFP_ZERO | __GFP_ACCOUNT); > >- if (!pte) > >- return NULL; > >- page = virt_to_page(pte); > >- if (!pgtable_page_ctor(page)) { > >- __free_page(page); > >- return NULL; > >- } > >- return page; > >-} > >- > >-static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) > >-{ > >- free_page((unsigned long)pte); > >-} > >- > >-static inline void pte_free(struct mm_struct *mm, pgtable_t ptepage) > >-{ > >- pgtable_page_dtor(ptepage); > >- __free_page(ptepage); > >-} > >- > > static inline void pgtable_free(void *table, int shift) > > { > > if (!shift) { > > > -- Sincerely yours, Mike.