Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2174197imu; Thu, 29 Nov 2018 00:12:43 -0800 (PST) X-Google-Smtp-Source: AFSGD/WcwZh2Xpxms2qFYzcgO5MXK2JGmQ2+Iz1AwzcFj7V+wIO3fX/SgPDF62pIoxoHjwqVHqyM X-Received: by 2002:a65:49cd:: with SMTP id t13mr423977pgs.376.1543479163554; Thu, 29 Nov 2018 00:12:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543479163; cv=none; d=google.com; s=arc-20160816; b=ygwkOrGoAJ2fIoUpMGcYw8EhS8iXdo32oj0Yyd1Qv6lbfPWDZh43xqi/tEEogAIDfH 86kXeUBi8DscDYEw3cfOYnY1PJKa+NSvlVf6Hu/SLU81DFzhEfLsxF71z0f6zehlH5Zf TNGr/g+r/Rju723GNcrVvzO7PBTOrIRuMen0kmPejFm5K+KMy4TV+tVV/KA0xUHWkyjX H54ztOt+skPOdY8fIxZd7JfsYOWysZnv4UGDHyPAQupbBHLu578wFbB9+lghx09Zisfu dEcexNxIEDWuCNGmdQRCvJpYCVMl3x6LGraN238MkDeLjlTMC2BEtLZorr7uT2QSX7jD s5hQ== 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=PNDQxeaG3oE1yoeNfi0GOkz3eUBePf8OlUK2nqPI6c0v8txucef40lj4WDANlsYN4t Anaza3/OgWg9F/XiiHWL2cmP+uaBaI7T0FQNebCnNSbhbZIc6IjFQAMWF8+wel1zgrKE nCFsnfslcLXNwK7WmlFFAnFDxpyj7+yRLvb6HPZVbWyTqDMvIzXe1Rvt6OqjTHt/iUEb OETR01lkK0ZGnCKeyOG0YVkNWhkdtL6vVsdLSck8hAB0AsZt2AtnpMzoAw969zwVwHm+ 9jCXKSrqb1eYVyjF/IOGuo7QQvZVyuucDG6uan3eArAUHODibcEa/XlxjndgDw9k39zt qJpw== 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 az5si1366861plb.166.2018.11.29.00.12.28; Thu, 29 Nov 2018 00:12:43 -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 S1728310AbeK2TPB (ORCPT + 99 others); Thu, 29 Nov 2018 14:15:01 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:27499 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727573AbeK2TPB (ORCPT ); Thu, 29 Nov 2018 14:15:01 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4359Dz5H53z9vGnx; Thu, 29 Nov 2018 09:10:27 +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 5LV9mAlIDjZv; Thu, 29 Nov 2018 09:10:27 +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 4359Dz4k6rz9vGnW; Thu, 29 Nov 2018 09:10:27 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 7C5FC8B891; Thu, 29 Nov 2018 09:10:28 +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 yMBIHVTCCBd8; Thu, 29 Nov 2018 09:10:28 +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 58A318B762; Thu, 29 Nov 2018 09:10:28 +0100 (CET) Received: by po14163vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 10C9169AEA; Thu, 29 Nov 2018 08:10:28 +0000 (UTC) Message-Id: <6c3ab117bbe83a4355023f592618af601fa3c6d4.1543478200.git.christophe.leroy@c-s.fr> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v8 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 08:10:28 +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