Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp801302yba; Fri, 26 Apr 2019 08:59:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqzqBbTHvopjbQzCXQsd094EtMnD//WRs16aqh2UjNas7qjKcvh+Flzi4Sm8u6K0BI9uYDkr X-Received: by 2002:a62:6342:: with SMTP id x63mr772551pfb.34.1556294378711; Fri, 26 Apr 2019 08:59:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556294378; cv=none; d=google.com; s=arc-20160816; b=a4ifTICcZUbJYrrCNubs9oFy3r+8XUU/n1vtYPDCY5Ln0kvGd3NSYGpSQkcpf5A+q1 x6TTcyi/QPntGBZiPI+Qr3/o6EQicKmmTvL4tYfedYqkjWLr05jWpkDNQM2i7V8YVImC UsM9bePl9zTH9jBHta1wRCO4J58hFPgpTjSGEB8o8oFqbtkHH4pGLPfKnEaX0uST+1v7 /VEjbPuDD76jbjIOgj+nFCvhCM+HHx/MvqD+wm3dCZzrM33uNs6I/f5n/qaEoRXd8gCb HV9TOJYjDmqtU/avYR1mtPd/Vn9boJI+n9Q8T5IIe/1E3/rf8sUE8ymXB55Cu9sKA7sp m9bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:references :in-reply-to:message-id:dkim-signature; bh=gq2Nx/itywCyxGDuPbA+x+AlDfSMPOE10U84+Sw7e6E=; b=sCXXrtxxag41u6wh0dfvSHyZy8MkxBEfejDrzOkeGe3zszr8E6vAksvz7UtANyd1v2 Xm4+vL/98yxXCn3jGTDTDaQHHmqXjfhy8I2DU+XRpYhaeArBMqebFDLvzzsmNoO8P+iI Eu432wENQMsf5hGr5td4Jx4uwvdnKAobE01UQtoWA6Qlo7hNF/r85wAWEs8bxEglA01n 3z2OzHIPDfJL1Axl9OHkub0JMKW9XQLeArCS3pQYm5JAMtHxF8UIz5xANv2KoGlnpv/+ QzaIO8YBLsTTvET9mFsbuzLclhS84nVaR5OM0efkqM5x9tRnipF73OVgEvqoaa8WR+xX ux3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=oYqoNCVF; 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 b10si2326833plk.13.2019.04.26.08.59.23; Fri, 26 Apr 2019 08:59:38 -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=oYqoNCVF; 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 S1726821AbfDZP6U (ORCPT + 99 others); Fri, 26 Apr 2019 11:58:20 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:51081 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726757AbfDZP6Q (ORCPT ); Fri, 26 Apr 2019 11:58:16 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 44rJcN4LM2z9v0yQ; Fri, 26 Apr 2019 17:58:12 +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=oYqoNCVF; 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 GMQg314ZIhAo; Fri, 26 Apr 2019 17:58:12 +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 44rJcN38l6z9v0yN; Fri, 26 Apr 2019 17:58:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1556294292; bh=gq2Nx/itywCyxGDuPbA+x+AlDfSMPOE10U84+Sw7e6E=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=oYqoNCVFYzZkaAEyPA83IDcET8iGXFTgMfaeZ98Woh1FTPwyxyZnrxSIQW+RSK5rj w9m7/kGhMVnP0iD7zWVglig4ds6acB91tfiX50i0faFTxmMS5fJ8kxCCo3Pfae7Dbo 9RKpLT9xeoAM/uKVoMKScvTfHE81mp3bt78XEJ/4= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 17A088B94A; Fri, 26 Apr 2019 17:58:14 +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 4KNfwYMLUf1F; Fri, 26 Apr 2019 17:58:14 +0200 (CEST) Received: from po16846vm.idsi0.si.c-s.fr (po15451.idsi0.si.c-s.fr [172.25.231.6]) by messagerie.si.c-s.fr (Postfix) with ESMTP id F39DC8B82F; Fri, 26 Apr 2019 17:58:13 +0200 (CEST) Received: by po16846vm.idsi0.si.c-s.fr (Postfix, from userid 0) id D2623666FE; Fri, 26 Apr 2019 15:58:13 +0000 (UTC) Message-Id: In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v2 15/15] powerpc/mm: refactor pgd_alloc() and pgd_free() on nohash To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , aneesh.kumar@linux.ibm.com Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Fri, 26 Apr 2019 15:58:13 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pgd_alloc() and pgd_free() are identical on nohash 32 and 64. Reviewed-by: Aneesh Kumar K.V Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/nohash/32/pgalloc.h | 11 ----------- arch/powerpc/include/asm/nohash/64/pgalloc.h | 11 ----------- arch/powerpc/include/asm/nohash/pgalloc.h | 12 ++++++++++++ 3 files changed, 12 insertions(+), 22 deletions(-) diff --git a/arch/powerpc/include/asm/nohash/32/pgalloc.h b/arch/powerpc/include/asm/nohash/32/pgalloc.h index 137761b01588..11eac371e7e0 100644 --- a/arch/powerpc/include/asm/nohash/32/pgalloc.h +++ b/arch/powerpc/include/asm/nohash/32/pgalloc.h @@ -5,17 +5,6 @@ #include #include -static inline pgd_t *pgd_alloc(struct mm_struct *mm) -{ - return kmem_cache_alloc(PGT_CACHE(PGD_INDEX_SIZE), - pgtable_gfp_flags(mm, GFP_KERNEL)); -} - -static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) -{ - kmem_cache_free(PGT_CACHE(PGD_INDEX_SIZE), pgd); -} - /* * We don't have any real pmd's, and this code never triggers because * the pgd will always be present.. diff --git a/arch/powerpc/include/asm/nohash/64/pgalloc.h b/arch/powerpc/include/asm/nohash/64/pgalloc.h index 5a0ea63c77c7..62321cd12da9 100644 --- a/arch/powerpc/include/asm/nohash/64/pgalloc.h +++ b/arch/powerpc/include/asm/nohash/64/pgalloc.h @@ -18,17 +18,6 @@ struct vmemmap_backing { }; extern struct vmemmap_backing *vmemmap_list; -static inline pgd_t *pgd_alloc(struct mm_struct *mm) -{ - return kmem_cache_alloc(PGT_CACHE(PGD_INDEX_SIZE), - pgtable_gfp_flags(mm, GFP_KERNEL)); -} - -static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) -{ - kmem_cache_free(PGT_CACHE(PGD_INDEX_SIZE), pgd); -} - #define pgd_populate(MM, PGD, PUD) pgd_set(PGD, (unsigned long)PUD) static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr) diff --git a/arch/powerpc/include/asm/nohash/pgalloc.h b/arch/powerpc/include/asm/nohash/pgalloc.h index 4fccac6af3ad..332b13b4ecdb 100644 --- a/arch/powerpc/include/asm/nohash/pgalloc.h +++ b/arch/powerpc/include/asm/nohash/pgalloc.h @@ -3,6 +3,7 @@ #define _ASM_POWERPC_NOHASH_PGALLOC_H #include +#include extern void tlb_remove_table(struct mmu_gather *tlb, void *table); #ifdef CONFIG_PPC64 @@ -16,6 +17,17 @@ static inline void tlb_flush_pgtable(struct mmu_gather *tlb, } #endif /* !CONFIG_PPC_BOOK3E */ +static inline pgd_t *pgd_alloc(struct mm_struct *mm) +{ + return kmem_cache_alloc(PGT_CACHE(PGD_INDEX_SIZE), + pgtable_gfp_flags(mm, GFP_KERNEL)); +} + +static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) +{ + kmem_cache_free(PGT_CACHE(PGD_INDEX_SIZE), pgd); +} + #ifdef CONFIG_PPC64 #include #else -- 2.13.3