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=-9.9 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 4619CC433E2 for ; Tue, 8 Sep 2020 10:26:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B9BE4208C7 for ; Tue, 8 Sep 2020 10:26:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B9BE4208C7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 211696B0055; Tue, 8 Sep 2020 06:26:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1C05F8E0003; Tue, 8 Sep 2020 06:26:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0625A8E0001; Tue, 8 Sep 2020 06:26:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0118.hostedemail.com [216.40.44.118]) by kanga.kvack.org (Postfix) with ESMTP id DD9E16B0055 for ; Tue, 8 Sep 2020 06:26:09 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id ACD47180AD822 for ; Tue, 8 Sep 2020 10:26:09 +0000 (UTC) X-FDA: 77239514058.28.gate17_35043e5270d4 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin28.hostedemail.com (Postfix) with ESMTP id 8C3866C05 for ; Tue, 8 Sep 2020 10:26:09 +0000 (UTC) X-HE-Tag: gate17_35043e5270d4 X-Filterd-Recvd-Size: 3456 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf30.hostedemail.com (Postfix) with ESMTP for ; Tue, 8 Sep 2020 10:26:09 +0000 (UTC) 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 49C7531B; Tue, 8 Sep 2020 03:26:08 -0700 (PDT) Received: from [10.163.71.211] (unknown [10.163.71.211]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DB8153F66E; Tue, 8 Sep 2020 03:26:04 -0700 (PDT) Subject: Re: [PATCH 1/2] arm64/mm: Change THP helpers to comply with generic MM semantics To: Ralph Campbell , Catalin Marinas Cc: linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, will@kernel.org, akpm@linux-foundation.org, Mark Rutland , Marc Zyngier , Suzuki Poulose , linux-kernel@vger.kernel.org References: <1597655984-15428-1-git-send-email-anshuman.khandual@arm.com> <1597655984-15428-2-git-send-email-anshuman.khandual@arm.com> <20200903165631.GC31409@gaia> <5e148194-58c2-89c2-2cd8-9f2086f1e090@nvidia.com> From: Anshuman Khandual Message-ID: <93ef8d6a-c86a-956b-5f06-5f2e67b6fd04@arm.com> Date: Tue, 8 Sep 2020 15:55:32 +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: <5e148194-58c2-89c2-2cd8-9f2086f1e090@nvidia.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US X-Rspamd-Queue-Id: 8C3866C05 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 09/03/2020 11:01 PM, Ralph Campbell wrote: >=20 > On 9/3/20 9:56 AM, Catalin Marinas wrote: >> On Mon, Aug 17, 2020 at 02:49:43PM +0530, Anshuman Khandual wrote: >>> pmd_present() and pmd_trans_huge() are expected to behave in the foll= owing >>> manner during various phases of a given PMD. It is derived from a pre= vious >>> detailed discussion on this topic [1] and present THP documentation [= 2]. >>> >>> pmd_present(pmd): >>> >>> - Returns true if pmd refers to system RAM with a valid pmd_page(pmd) >>> - Returns false if pmd does not refer to system RAM - Invalid pmd_pag= e(pmd) >> >> The second bullet doesn't make much sense. If you have a pmd mapping o= f >> some I/O memory, pmd_present() still returns true (as does >> pte_present()). >> >>> diff --git a/arch/arm64/include/asm/pgtable-prot.h b/arch/arm64/inclu= de/asm/pgtable-prot.h >>> index 4d867c6446c4..28792fdd9627 100644 >>> --- a/arch/arm64/include/asm/pgtable-prot.h >>> +++ b/arch/arm64/include/asm/pgtable-prot.h >>> @@ -19,6 +19,13 @@ >>> =C2=A0 #define PTE_DEVMAP=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (= _AT(pteval_t, 1) << 57) >>> =C2=A0 #define PTE_PROT_NONE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= (_AT(pteval_t, 1) << 58) /* only when !PTE_VALID */ >>> =C2=A0 +/* >>> + * This help indicate that the entry is present i.e pmd_page() >> >> Nit: add another . after i.e >=20 > Another nit: "This help indicate" =3D> "This helper indicates" >=20 > Maybe I should look at the series more. :-) It is talking about the new PTE bit being used here not any helper. Though the following replacement might be better. s/This help indicate/This bit indicates/ /* * This help indicate that the entry is present i.e pmd_page() * still points to a valid huge page in memory even if the pmd * has been invalidated. */ #define PMD_PRESENT_INVALID (_AT(pteval_t, 1) << 59) /* only when !PMD_SE= CT_VALID */