From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84EF6C43219 for ; Thu, 2 May 2019 16:56:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 57DFD20C01 for ; Thu, 2 May 2019 16:56:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=c-s.fr header.i=@c-s.fr header.b="b8I7W1X+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726808AbfEBQ4N (ORCPT ); Thu, 2 May 2019 12:56:13 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:38953 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726472AbfEBQ4M (ORCPT ); Thu, 2 May 2019 12:56:12 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 44w1cS5Fwsz9v0Sx; Thu, 2 May 2019 18:56:08 +0200 (CEST) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=b8I7W1X+; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id 4wFI9OSqYAkB; Thu, 2 May 2019 18:56:08 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 44w1cS3z29z9v0Sy; Thu, 2 May 2019 18:56:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1556816168; bh=Q15LZ3d9bdq9dEoD9BccUn9mlT4iR41PhF1gwPGTDdo=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=b8I7W1X+eD9E6f4QICHVyiGb2O+HBaJpc4Gwg6pUFtlpNKygpjn8VED8m8xg+JkOB IY+qSAZGLB4WFz+ZuAhNE6IOZlIPudaswik9x6vnbwMIKU3+fxYh/fSD0okZc5lnaA cdvwJC11zLQtHCiz8Kggoo4ZlThkHqB1Sg9CxUag= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 3A25B8B8FE; Thu, 2 May 2019 18:56:10 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id RamEpSyy5iYB; Thu, 2 May 2019 18:56:10 +0200 (CEST) Received: from PO15451 (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id CE4878B899; Thu, 2 May 2019 18:56:08 +0200 (CEST) Subject: Re: [PATCH 12/15] powerpc/nohash/64: switch to generic version of pte allocation To: Mike Rapoport , Andrew Morton Cc: 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 References: <1556810922-20248-1-git-send-email-rppt@linux.ibm.com> <1556810922-20248-13-git-send-email-rppt@linux.ibm.com> From: Christophe Leroy Message-ID: Date: Thu, 2 May 2019 18:56:07 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <1556810922-20248-13-git-send-email-rppt@linux.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org 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/ 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) { >