Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp505155yba; Wed, 3 Apr 2019 13:07:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqzf7RgdLYyw34y4LWjFw7lRVz8nqqfxiDsl3bVycglfOujyG2ntJsNzILpNsF8vetxfHfDB X-Received: by 2002:a63:b305:: with SMTP id i5mr1550439pgf.274.1554322062704; Wed, 03 Apr 2019 13:07:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554322062; cv=none; d=google.com; s=arc-20160816; b=YAhBHBiAEswDv5EtnkahUcRkCY9nenWX62ZwyrCmRmPAyevAqAu/FBcYjc7fRrPEDA Q+ged1xNVYs+FWZmMPnr2EEix/8PuKAokLYPWZFhPCIMszp6E24/4a8N0tPOncmlK/mU XkjAc4RAhrkja4QMzJoJAdfKjnR3FVqYTRKpynaEWC5N7ekFFiSoiHAF2MJrnIcVdhaJ YGQ4OyePUBH+xoSmlxbZ4IA+saUNaQWXy9NewqrpFJvPttCvMzLRnWAMy5NQthU9F+rR 8eTBRVD1CTaWq9PKXbTvMgOERl/ZieoRdUbJbQe5sgwXpNfe6+1Hhjr5293XKw1pfike NFOA== 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=KMLQNS656LPk8TrOzEewpXov97NObk8UyA43BCDWep8=; b=RQXceBEMCAlzoqmY16V2AEumKDyIjqho1eP691S1o0sWRB0oFhU+5GomBJXvkczmo7 UiA0xFcWB5Ei8KAh3fmF/OsN1eJrDuIyGuYRBgU+GMdkFZfsc8hSK9dZ+/uflWRWVPkV oDSNb8vJnd61efGnrg729DVckS+r7/3P+iuFjOOSEtBAHRVCD7naPu88nyevsJFaVFol NOOP6rry1yk8af9jkWz3SIwCigKejd9nQuhfr99v6Y0AX0/KkU4rRYuAG7i8Cm70KgKi YPEunqrUd9DJefP5r5+6afMgAWfCL1qvruFqshFGp9eXp2Cpfb66JBuXGvY9ZQA88sNN fJRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=JHnJQ6ye; 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 z9si14166928pgp.375.2019.04.03.13.07.27; Wed, 03 Apr 2019 13:07:42 -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=JHnJQ6ye; 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 S1727153AbfDCUGh (ORCPT + 99 others); Wed, 3 Apr 2019 16:06:37 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:40630 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727011AbfDCUG3 (ORCPT ); Wed, 3 Apr 2019 16:06:29 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 44ZHCR7092z9v3q1; Wed, 3 Apr 2019 22:06:27 +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=JHnJQ6ye; 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 vdEa6pStQStb; Wed, 3 Apr 2019 22:06:27 +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 44ZHCR5vbHz9v3pn; Wed, 3 Apr 2019 22:06:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1554321987; bh=KMLQNS656LPk8TrOzEewpXov97NObk8UyA43BCDWep8=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=JHnJQ6yeF3lB+dmZJgeHtK+d0dz67U8hcQ5dPMl9KcLSzx0nlZStOXw3kx4DUFfRW 4boyDSLGvgHEGQwKZg1bgoqzPimxYVgIfQ9CHSr2wUV6nQLMYAG2SLRL4x6GEtNi8F mJ3PuPWapdwQOhu8/BFw6NJfEmygfSuMVGg9oKNY= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id ECBDC8B905; Wed, 3 Apr 2019 22:06:27 +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 Ejl1dJDN_uOx; Wed, 3 Apr 2019 22:06:27 +0200 (CEST) Received: from po16846vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id C5BFF8B902; Wed, 3 Apr 2019 22:06:27 +0200 (CEST) Received: by po16846vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 9D87E655EC; Wed, 3 Apr 2019 20:06:27 +0000 (UTC) Message-Id: <427a67a11b408839062dbf2677964d0bd4bb1886.1554321743.git.christophe.leroy@c-s.fr> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v1 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: Wed, 3 Apr 2019 20:06:27 +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. 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