Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2506479imu; Thu, 29 Nov 2018 06:10:21 -0800 (PST) X-Google-Smtp-Source: AFSGD/UbTTuvdfM+A0XpMtIb9IX4SZLvmwMV1f2cgHV1EmAvKjrN1AUdCC1YkQ0HQq41/xh7ZOCy X-Received: by 2002:a62:6503:: with SMTP id z3mr1476820pfb.169.1543500621079; Thu, 29 Nov 2018 06:10:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543500621; cv=none; d=google.com; s=arc-20160816; b=qQG6C8pl7T/5iMURpNxPRkxiCNTX+PanDVtCcejaNlwgtOppheuTTNVwaAouZiAFG4 kl7ZZmRjCuV8hfESw/bAAJTUtM6puV1LQ1EhSxKtx9H1wsKsg/lQTMK7tqZPeHAmzeVU 3gA9uBVN1r3t/BEX7Kk9vGHxP0/lvlDUT8MKpz1yOgxwXWJhLzImhHYwXaqzmERDzUmU gXdSlOvtqYPe/ZKxv6H6dGT+vMCgMA9U9LTkMncs71TNks060J+ZddgUqf6LXBrbHBM1 bSUS60nq9HrpuEjaLAwTU/CtL5gHtt6mrMridcQqAhhHmQt/tPQWrYOW5NylGOofnNTb JyYQ== 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; bh=LEstIe67gouF73jfCig04j8Vbt1clyTBC0jUKwg71tM=; b=tmZkbg8NP6K3mKDBnebDZzNXFz4KxltcTAOZaV0y4rpKwOLMLP3F37JNhlL1tLAiwn ZWIvc9BM1rqUf0HILqH0GDb17po2Q76nELGJqh/hBLu4tvqvYm6wyMk4neFqxWZyOYsG 4QICtohHAY0zviC/SGbP/e19R2aZtzV0U5Ee1rKu9uu/dYF/zMou1FlGF8eLgmu7/tW0 iZp6zsjxkOpFbAXJMNLbnbME4EnqQaRCPDYHJfVeO8zpxrVleCSqmbEoJNbB6BJ2U+3U EsYDuIWPOndPB0ZagLNYiqlLI0AvL6goKvx8Bp7NbB+uluvcQZV3jE4BrgeZK3NdOTvm 3pow== ARC-Authentication-Results: i=1; mx.google.com; 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 q5si2096772pgb.245.2018.11.29.06.10.04; Thu, 29 Nov 2018 06:10:21 -0800 (PST) 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; 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 S1728828AbeK3BMk (ORCPT + 99 others); Thu, 29 Nov 2018 20:12:40 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:18010 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728810AbeK3BMk (ORCPT ); Thu, 29 Nov 2018 20:12:40 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 435K8Y3pDzz9vGF7; Thu, 29 Nov 2018 15:07:09 +0100 (CET) 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 hNEymsADsXoD; Thu, 29 Nov 2018 15:07:09 +0100 (CET) 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 435K8Y34Vkz9vGDm; Thu, 29 Nov 2018 15:07:09 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 96C898B89E; Thu, 29 Nov 2018 15:07:10 +0100 (CET) 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 uE9eToTDJ0C1; Thu, 29 Nov 2018 15:07:10 +0100 (CET) Received: from po14163vm.idsi0.si.c-s.fr (unknown [192.168.232.3]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 613298B899; Thu, 29 Nov 2018 15:07:10 +0100 (CET) Received: by po14163vm.idsi0.si.c-s.fr (Postfix, from userid 0) id CA7D869AE8; Thu, 29 Nov 2018 14:07:09 +0000 (UTC) Message-Id: <48a91a791ec090d1907bef5ea7ec16b406cf1929.1543499864.git.christophe.leroy@c-s.fr> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v9 12/20] powerpc/mm: remove unnecessary test in pgtable_cache_init() To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Thu, 29 Nov 2018 14:07:09 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pgtable_cache_add() gracefully handles the case when a cache that size already exists by returning early with the following test: if (PGT_CACHE(shift)) return; /* Already have a cache of this size */ It is then not needed to test the existence of the cache before. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/init-common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/mm/init-common.c b/arch/powerpc/mm/init-common.c index b7ca03643d0b..1e6910eb70ed 100644 --- a/arch/powerpc/mm/init-common.c +++ b/arch/powerpc/mm/init-common.c @@ -111,13 +111,13 @@ void pgtable_cache_init(void) { pgtable_cache_add(PGD_INDEX_SIZE); - if (PMD_CACHE_INDEX && !PGT_CACHE(PMD_CACHE_INDEX)) + if (PMD_CACHE_INDEX) pgtable_cache_add(PMD_CACHE_INDEX); /* * In all current configs, when the PUD index exists it's the * same size as either the pgd or pmd index except with THP enabled * on book3s 64 */ - if (PUD_CACHE_INDEX && !PGT_CACHE(PUD_CACHE_INDEX)) + if (PUD_CACHE_INDEX) pgtable_cache_add(PUD_CACHE_INDEX); } -- 2.13.3