From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1696FC433E2 for ; Fri, 11 Sep 2020 07:03:01 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 87A9E221EF for ; Fri, 11 Sep 2020 07:03:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="kKJaLeUo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 87A9E221EF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:References: To:Subject:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=iXAjhN9b7iHAR4O/fMZto5ESxdMsOBOx23oqTgAxmXI=; b=kKJaLeUoT6uiJiAw+ZLh9FFcE Mb08VSQo5VKT0ZlXablz85xJlu/gEKAscSBWw+K/Kdhk5V06l/iKIywugJ7ZKSR/dKx2lb0pKrm3N e0+VvFqZWZEE5ZfI3Ssobr/O8GJC86HvZ88r/J5s0YTswGppMY20XFA4Jd9RqIeNBkuatjjMhHsDK WB4H68014BJ54pCWU5P1Y5qZLH7dlqVjJlqU9DOVRvFNTFHn5Qgk8DNs4zKYnMQendl5SpmT/PYCi qRBzLfN06RShgPw1falyzAqlVfrz3Vwam93I6rCVIT+hEdC5lYEWx3G01YY+Klo5HiZy4Mr2gVD2e avOPN65OQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGd3s-0001dk-D1; Fri, 11 Sep 2020 07:01:32 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGd3p-0001dC-B5 for linux-arm-kernel@lists.infradead.org; Fri, 11 Sep 2020 07:01:30 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id AC7EA113E; Fri, 11 Sep 2020 00:01:26 -0700 (PDT) Received: from [192.168.0.130] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D55FF3F73C; Fri, 11 Sep 2020 00:01:24 -0700 (PDT) From: Anshuman Khandual Subject: Re: [PATCH v2 2/3] arm64/mm: Unitify CONT_PTE_SHIFT To: Gavin Shan , linux-arm-kernel@lists.infradead.org References: <20200910095936.20307-1-gshan@redhat.com> <20200910095936.20307-2-gshan@redhat.com> Message-ID: Date: Fri, 11 Sep 2020 12:30:31 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200910095936.20307-2-gshan@redhat.com> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200911_030129_478151_1BBCB06C X-CRM114-Status: GOOD ( 21.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: catalin.marinas@arm.com, will@kernel.org, linux-kernel@vger.kernel.org, shan.gavin@gmail.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 09/10/2020 03:29 PM, Gavin Shan wrote: > CONT_PTE_SHIFT actually depends on CONFIG_ARM64_CONT_SHIFT. It's > reasonable to reflect the dependency: Also always better to avoid direct numerical such as 5, 7, 4. A config option with a right name (even with constant values), gives them some meaning. > > * This renames CONFIG_ARM64_CONT_SHIFT to CONFIG_ARM64_CONT_PTE_SHIFT, > so that we can introduce CONFIG_ARM64_CONT_PMD_SHIFT later. Agreed. > > * CONT_{SHIFT, SIZE, MASK}, defined in page-def.h are removed as they > are not used by anyone. Makes sense. > > * CONT_PTE_SHIFT is determined by CONFIG_ARM64_CONT_PTE_SHIFT. > > Signed-off-by: Gavin Shan > --- > arch/arm64/Kconfig | 2 +- > arch/arm64/include/asm/page-def.h | 5 ----- > arch/arm64/include/asm/pgtable-hwdef.h | 4 +--- > 3 files changed, 2 insertions(+), 9 deletions(-) > > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig > index 6d232837cbee..7ec30dd56300 100644 > --- a/arch/arm64/Kconfig > +++ b/arch/arm64/Kconfig > @@ -211,7 +211,7 @@ config ARM64_PAGE_SHIFT > default 14 if ARM64_16K_PAGES > default 12 > > -config ARM64_CONT_SHIFT > +config ARM64_CONT_PTE_SHIFT > int > default 5 if ARM64_64K_PAGES > default 7 if ARM64_16K_PAGES > diff --git a/arch/arm64/include/asm/page-def.h b/arch/arm64/include/asm/page-def.h > index f99d48ecbeef..2403f7b4cdbf 100644 > --- a/arch/arm64/include/asm/page-def.h > +++ b/arch/arm64/include/asm/page-def.h > @@ -11,13 +11,8 @@ > #include > > /* PAGE_SHIFT determines the page size */ > -/* CONT_SHIFT determines the number of pages which can be tracked together */ This does not get added back in , would you please add one comment, for both CONT_PTE_SHIFT and CONT_PMD_SHIFT in their respective patches. > #define PAGE_SHIFT CONFIG_ARM64_PAGE_SHIFT > -#define CONT_SHIFT CONFIG_ARM64_CONT_SHIFT > #define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT) > #define PAGE_MASK (~(PAGE_SIZE-1)) > > -#define CONT_SIZE (_AC(1, UL) << (CONT_SHIFT + PAGE_SHIFT)) > -#define CONT_MASK (~(CONT_SIZE-1)) > - > #endif /* __ASM_PAGE_DEF_H */ > diff --git a/arch/arm64/include/asm/pgtable-hwdef.h b/arch/arm64/include/asm/pgtable-hwdef.h > index 8a399e666837..6c9c67f62551 100644 > --- a/arch/arm64/include/asm/pgtable-hwdef.h > +++ b/arch/arm64/include/asm/pgtable-hwdef.h > @@ -81,14 +81,12 @@ > /* > * Contiguous page definitions. > */ > +#define CONT_PTE_SHIFT (CONFIG_ARM64_CONT_PTE_SHIFT + PAGE_SHIFT) > #ifdef CONFIG_ARM64_64K_PAGES > -#define CONT_PTE_SHIFT (5 + PAGE_SHIFT) > #define CONT_PMD_SHIFT (5 + PMD_SHIFT) > #elif defined(CONFIG_ARM64_16K_PAGES) > -#define CONT_PTE_SHIFT (7 + PAGE_SHIFT) > #define CONT_PMD_SHIFT (5 + PMD_SHIFT) > #else > -#define CONT_PTE_SHIFT (4 + PAGE_SHIFT) > #define CONT_PMD_SHIFT (4 + PMD_SHIFT) > #endif > > Looks good to me and there are no obvious regressions as well. Reviewed-by: Anshuman Khandual _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel