Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp7444673yba; Thu, 2 May 2019 09:57:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqwPcHBU23YI6v8bx2/z932dbgj1w+kniTh3X2du0SnUQKN/RHrrrGYErnqfwwXfvlgheIhh X-Received: by 2002:a63:188:: with SMTP id 130mr5074203pgb.391.1556816245105; Thu, 02 May 2019 09:57:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556816245; cv=none; d=google.com; s=arc-20160816; b=zpwSqoBgzEXfGrgXhGGD72BCmSzUPr02CoUIetyvi4IlmPR7F0mrMix2w9vS9IB0Re dLTmsDCpPrfxxckEVnbCcqh1H7Acqjx5WOAG0dUuqVJa87hC5ntIdZG2qqAsWtx2PYuY VqmDDNglQyCJewZV6hwXwjo7CyLagI7fbbvbfDQR6jHr5G37hr5trjB2H+tcCrgwn77R q/nrmVz09pQ2Vnsckd194zC6O9Bv8+6lcUyDu03POB3VkN4fMXxuUB8v7jfcgLXDyjgu Gxpvc6EBleBTfCJlZx2Xt8amOJE/ZlkvtegLArZ9nYMl8VYxRsMeWHkDdC/NyVIeaSws GxwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=Q15LZ3d9bdq9dEoD9BccUn9mlT4iR41PhF1gwPGTDdo=; b=Do1VUu0V9iGsEqBM0wR7fT73lK8VvrInnGXYK+AqETsMzoR84HJKlhmPdBuwP70XHE VNluHDNVZxifKS7RqJsVr2hAnGuGhcBNfh2N/WC9WKgaf788+8zsBX+2QYkFqw0o35gf 2hGopDvJvFjJFEt7GvcHL2Kn71mTPCLa9zuPR47u26o4Q/Yg0ibMWvsbtROBz4aWl1Qo lO4GpJ7yp0fK0gLt0I2IjkkLfVxHCOfMjSh9gQyIKxqBDAR+csky7v6w3tTXrCtzxoeE n+sT1oc/X86RdcWEAZX+qtyQulEzXWWBKwQGQAXgCT7xAaEf1REretz895HckomGpdq7 tcfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=b8I7W1X+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e192si42658003pgc.222.2019.05.02.09.57.09; Thu, 02 May 2019 09:57:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=b8I7W1X+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726839AbfEBQ4N (ORCPT + 99 others); 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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) { >